From 6c6407f124fde6bcf27a3a155981d64ec8d2db2a Mon Sep 17 00:00:00 2001 From: Johannes Loher Date: Wed, 30 Dec 2020 21:51:09 +0100 Subject: [PATCH 1/2] improve node_modules caching --- .gitlab-ci.yml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 86353bc6..4241ea62 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,7 @@ image: node:latest stages: - - mytest + - prepare - test - build - deploy @@ -12,17 +12,25 @@ cache: &global_cache - package-lock.json policy: pull paths: - - .npm/ + - node_modules/ + +install-dependencies: + stage: prepare + script: + - npm install + cache: + <<: *global_cache + policy: pull-push + # only: + # changes: + # - package-lock.json lint: stage: test - before_script: - - npm ci --cache .npm --prefer-offline script: - npm run lint cache: <<: *global_cache - policy: pull-push # Test: # stage: Test @@ -33,8 +41,6 @@ lint: build: stage: build - before_script: - - npm ci --cache .npm --prefer-offline script: - npm run build cache: From cd581a55cee2b938b07f8c3390d3dbc44625e44c Mon Sep 17 00:00:00 2001 From: Johannes Loher Date: Wed, 30 Dec 2020 22:04:12 +0100 Subject: [PATCH 2/2] remove unnecessary comment --- .gitlab-ci.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4241ea62..c9a33af4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -21,9 +21,6 @@ install-dependencies: cache: <<: *global_cache policy: pull-push - # only: - # changes: - # - package-lock.json lint: stage: test