I have created nice I think script for CI.
So it only does npm install
when package.json changes.
other than that it does lint script and build script from cache.
But occasionally I get error that looks like cache wasn’t properly loaded?
If I do retry sometimes more than once, it works eventually. Why is this happening ?
and script:
install:
stage: install
tags:
- test
- vuejs
cache:
untracked: true
key: one-key-to-rule-them-all
paths:
- node_modules/
- package-lock.json
script:
- rm package-lock.json || true
- npm install
only:
refs:
- merge_requests
changes:
- package.json
lint:
stage: lint
tags:
- test
- vuejs
cache:
untracked: true
key: one-key-to-rule-them-all
paths:
- node_modules/
- package-lock.json
policy: pull
script:
- npm run lint
- npm run lint:css
only:
- merge_requests