This is the codeAbility Sharing Platform! Learn more about the codeAbility Sharing Platform.

Skip to content
Snippets Groups Projects
Commit af68b142 authored by Daniel Rainer's avatar Daniel Rainer
Browse files

Cache node_modules, run npm install only once

parent 924eb648
Branches
2 merge requests!105Preparing März Release,!95Improve pipeline
image: jhipster/jhipster:v7.6.0
cache:
key: '$CI_COMMIT_REF_NAME'
paths:
- .maven/
- key: '$CI_COMMIT_REF_NAME'
paths:
- .maven/
- key:
files:
- package-lock.json
paths:
- node_modules/
stages:
- setup
- lint
- build
- test
......@@ -12,10 +19,16 @@ stages:
- package
- release
- deploy
before_script:
- export NG_CLI_ANALYTICS="false"
- export MAVEN_USER_HOME=`pwd`/.maven
npm-install:
stage: setup
script:
- npm install
checkstyle:
stage: lint
script:
......@@ -25,20 +38,18 @@ checkstyle:
prettier:
stage: lint
script:
- npm install
- npm run prettier:check
allow_failure: true
needs: []
needs: [npm-install]
eslint:
stage: lint
script:
- npm install
# eslint exits 0 on warnings, this is a workaround to exit 1 when warnings are present.
- 'npm run lint | tee lint.log'
- "! grep -qE '✖ [0-9]+ problem' lint.log"
allow_failure: true
needs: []
needs: [npm-install]
maven-compile:
stage: build
......@@ -80,7 +91,6 @@ maven-test:
frontend-test:
stage: test
script:
- npm install
- npm test
artifacts:
reports:
......@@ -91,7 +101,7 @@ frontend-test:
when: always
expire_in: 1 day
allow_failure: true
needs: []
needs: [npm-install]
sonar-analyze:
stage: analyze
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment