stages:
- install
- build
- test
variables:
FF_USE_FAST_ZIP: 'true'
ARTIFACT_COMPRESSION_LEVEL: 'fast'
CACHE_COMPRESSION_LEVEL: 'fast'
cache:
paths:
- .yarn
- node_modules
key:
files:
- yarn.lock
untracked: true
policy: pull
install:
stage: install
script:
- yarn install --immutable
# artifacts:
# paths:
# - node_modules/
# expire_in: 1 day
cache:
key:
files:
- yarn.lock
policy: pull-push
when: on_success
paths:
- .yarn
- node_modules
build:
stage: build
artifacts:
paths:
- packages/*/dist
expire_in: 1 day
script:
- yarn build:remote-cache
check-dependencies:
stage: test
needs: [install]
script:
- yarn install
- yarn dependsOnCheck
dependencies: []
I’m trying to cache the node_modules in the Gitlab CI Pipeline, so that the node_modules is just one time installed.
But I receive this error the most time in my current configuration:
Usage Error: Couldn't find the node_modules state file - running an install might help (findPackageLocation)
When I’m adding the artifacts to the install job, it works. But the downloading does take I want to save from the caching.
Not every time but mostly