From a67102d21dbc2e8bb38168f5315776c22077152e Mon Sep 17 00:00:00 2001
From: Alexander Harkness <me@bearbin.net>
Date: Fri, 11 Oct 2019 15:54:28 +0100
Subject: [PATCH] Optimise remaining npm development installations

---
 .gitlab-ci.yml | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 7733c96..0573da0 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -16,20 +16,32 @@ node_install:
     paths:
       - node_modules
 
+dev_node_install:
+  stage: deps
+  script:
+    - npm ci
+  artifacts:
+    paths:
+      - node_modules
+
 check_format:
   stage: check
+  dependencies:
+    - dev_node_install
   script:
-    - npm ci
     - npx prettier --ignore-path .gitignore --check "**/*.{html,js,json,md}"
 
 lint:
   stage: check
+  dependencies:
+    - dev_node_install
   script:
-    - npm ci
     - npx eslint --ignore-path .gitignore "**/*.js"
 
 backend_build:
   stage: build
+  dependencies:
+    - node_install
   script:
     - npm run build
   artifacts:
@@ -38,12 +50,16 @@ backend_build:
 
 backend_test:
   stage: test
+  dependencies:
+    - dev_node_install
   script:
-    - npm ci
     - npm test
 
 deploy:
   stage: deploy
+  dependencies:
+    - node_install
+    - backend_build
   only:
     - master
   script:
-- 
GitLab