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

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

Cache node_modules, run npm install only once

parent 5deb5400
2 merge requests!188Merging Peer Reviewing et. al to Master,!164211 peer reviewing functionality
image: jhipster/jhipster:v7.6.0 image: jhipster/jhipster:v7.6.0
cache: cache:
key: '$CI_COMMIT_REF_NAME' - key: '$CI_COMMIT_REF_NAME'
paths: paths:
- .maven/ - .maven/
- key:
files:
- package-lock.json
paths:
- node_modules/
stages: stages:
- setup
- lint - lint
- build - build
- test - test
...@@ -12,10 +19,16 @@ stages: ...@@ -12,10 +19,16 @@ stages:
- package - package
- release - release
- deploy - deploy
before_script: before_script:
- export NG_CLI_ANALYTICS="false" - export NG_CLI_ANALYTICS="false"
- export MAVEN_USER_HOME=`pwd`/.maven - export MAVEN_USER_HOME=`pwd`/.maven
npm-install:
stage: setup
script:
- npm install
checkstyle: checkstyle:
stage: lint stage: lint
script: script:
...@@ -25,20 +38,18 @@ checkstyle: ...@@ -25,20 +38,18 @@ checkstyle:
prettier: prettier:
stage: lint stage: lint
script: script:
- npm install
- npm run prettier:check - npm run prettier:check
allow_failure: true allow_failure: true
needs: [] needs: [npm-install]
eslint: eslint:
stage: lint stage: lint
script: script:
- npm install
# eslint exits 0 on warnings, this is a workaround to exit 1 when warnings are present. # eslint exits 0 on warnings, this is a workaround to exit 1 when warnings are present.
- 'npm run lint | tee lint.log' - 'npm run lint | tee lint.log'
- "! grep -qE '✖ [0-9]+ problem' lint.log" - "! grep -qE '✖ [0-9]+ problem' lint.log"
allow_failure: true allow_failure: true
needs: [] needs: [npm-install]
maven-compile: maven-compile:
stage: build stage: build
...@@ -80,7 +91,6 @@ maven-test: ...@@ -80,7 +91,6 @@ maven-test:
frontend-test: frontend-test:
stage: test stage: test
script: script:
- npm install
- npm test - npm test
artifacts: artifacts:
reports: reports:
...@@ -91,7 +101,7 @@ frontend-test: ...@@ -91,7 +101,7 @@ frontend-test:
when: always when: always
expire_in: 1 day expire_in: 1 day
allow_failure: true allow_failure: true
needs: [] needs: [npm-install]
sonar-analyze: sonar-analyze:
stage: 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