try caching npm in gitlab-ci

indiachan-spamvector
Thomas Lynch 2 years ago
parent 4dc95a958a
commit 6ddbfc450a
Signed by: fatchan
GPG Key ID: 112884AA57DF40B1
  1. 13
      .gitlab-ci.yml

@ -1,14 +1,23 @@
image: node:latest image: node:latest
# Cache modules in between jobs
cache:
key: $CI_COMMIT_REF_SLUG
paths:
- .npm/
before_script:
- npm ci --cache .npm --prefer-offline
# Code linting # Code linting
eslint: eslint:
stage: .pre stage: .pre
rules: rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event' - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
script: script:gb
- 'npm i -g eslint-cli' - 'npm i -g eslint-cli'
- 'npm i eslint --save-dev' - 'npm i eslint --save-dev'
- 'node node_modules/eslint/bin/eslint.js' - 'node node_modules/eslint/bin/eslint.js ./'
allow_failure: true allow_failure: true
# Run tests # Run tests

Loading…
Cancel
Save