From 73b62b9c9e75d70c8fbf68a28bdd3d6bdfc721a4 Mon Sep 17 00:00:00 2001
From: Steve Reis <stevereis93@gmail.com>
Date: Fri, 22 Apr 2022 12:59:50 +0000
Subject: [PATCH] Add dedicated stage for testing in CI

---
 .gitlab-ci.yml | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 00c4c74..48d0bca 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,4 +1,5 @@
 stages:
+  - test
   - build
   - release
 
@@ -8,6 +9,23 @@ services:
 before_script:
   - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
 
+test:
+  image: node:16.14-alpine
+  stage: test
+  only:
+    refs:
+    - main
+    - rc
+    - beta
+    - develop
+    # This matches maintenance branches
+    - /^(([0-9]+)\.)?([0-9]+)\.x/
+    # This matches pre-releases
+    - /^([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?$/
+  script: 
+    - npm ci --development
+    - npm run test
+
 build:
   image: docker:dind
   stage: build
-- 
GitLab