diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 53713d74bbb4d8157d8784e986cd6f06835dbe42..dcab6143bbbd60a26a5a6942a1b90e17fe35b19e 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