From d10867358275183b152a282d4d1d64d980ae6d30 Mon Sep 17 00:00:00 2001
From: Erik Borgeteien Hansen <erik@erikbhan.no>
Date: Wed, 27 Apr 2022 10:31:19 +0200
Subject: [PATCH] test

---
 .gitlab-ci.yml | 46 +++++++++++++---------------------------------
 1 file changed, 13 insertions(+), 33 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 53713d7..dcab614 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,37 +1,17 @@
-image: node:16-alpine
+#
+# https://gitlab.com/gitlab-org/gitlab/-/tree/master/lib/gitlab/ci/templates/Nodejs.gitlab-ci.yml
+#
+image: node:latest
 
-stages:
-  - build
-  - test
-  # - deploy
+# Cache modules in between jobs
+cache:
+  key: $CI_COMMIT_REF_SLUG
+  paths:
+    - .npm/
 
-install:
-  stage: .pre
-  cache: 
-    key: $CI_COMMIT_REF_SLUG-$CI_PROJECT_DIR
-    paths:
-      - node_modules/
-  # before_script: #Runs before script; in case we need .envs later
-  #   - cp .env.gitlab-testing .env
-  script:
-    - npm ci
-  only:
-    changes:
-      - package-lock.json
+before_script:
+  - npm ci --cache .npm --prefer-offline
 
-build:
-  stage: build
-  cache: 
-    key: $CI_COMMIT_REF_SLUG-$CI_PROJECT_DIR
-    paths:
-      - node_modules/
-    policy: pull
+test_async:
   script:
-    - npm run build
-  artifacts:
-    paths:
-      - build
-
-run_tests:
-  stage: test
-  script: npm run test:unit
\ No newline at end of file
+    - npm run test:unit
\ No newline at end of file
-- 
GitLab