From 735abf821e78b40f4e0cc0263f823f555c6ac147 Mon Sep 17 00:00:00 2001
From: Daniel Rainer <daniel.m.rainer@student.uibk.ac.at>
Date: Sat, 5 Mar 2022 17:39:10 +0100
Subject: [PATCH] Revert "Cache node_modules, run npm install only once"

This reverts commit af68b142eb9843551eea2b24919a32b8662997b9.
---
 .gitlab-ci.yml | 28 +++++++++-------------------
 1 file changed, 9 insertions(+), 19 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index bae7ac646..91d186aae 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,17 +1,10 @@
 image: jhipster/jhipster:v7.6.0
 
 cache:
-  - key: '$CI_COMMIT_REF_NAME'
-    paths:
-      - .maven/
-  - key:
-      files:
-        - package-lock.json
-    paths:
-      - node_modules/
-
+  key: '$CI_COMMIT_REF_NAME'
+  paths:
+    - .maven/
 stages:
-  - setup
   - lint
   - build
   - test
@@ -19,16 +12,10 @@ 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:
@@ -38,18 +25,20 @@ checkstyle:
 prettier:
   stage: lint
   script:
+    - npm install
     - npm run prettier:check
   allow_failure: true
-  needs: [npm-install]
+  needs: []
 
 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: [npm-install]
+  needs: []
 
 maven-compile:
   stage: build
@@ -91,6 +80,7 @@ maven-test:
 frontend-test:
   stage: test
   script:
+    - npm install
     - npm test
   artifacts:
     reports:
@@ -101,7 +91,7 @@ frontend-test:
     when: always
     expire_in: 1 day
   allow_failure: true
-  needs: [npm-install]
+  needs: []
 
 sonar-analyze:
   stage: analyze
-- 
GitLab