diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 91d186aaed1493bc9270ec426642b987cba4fdf7..bae7ac646d19e14a81f34e411e3f3ab2337960ff 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,10 +1,17 @@ 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