Skip to content
Snippets Groups Projects
Commit 55f75d0e authored by Erik Borgeteien Hansen's avatar Erik Borgeteien Hansen
Browse files

Merge branch 'cicd' into 'main'

Cicd

See merge request !33
parents 8960de10 c7dfb38a
No related branches found
No related tags found
1 merge request!33Cicd
Pipeline #176817 failed
image: node:lts image: node:16
stages: stages:
- build - setup
- test - test
# - deploy
# These folders are cached between builds variables:
# http://docs.gitlab.com/ce/ci/yaml/README.html#cache npm_config_cache: "$CI_PROJECT_DIR/.npm"
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
# Default cache directory from https://classic.yarnpkg.com/en/docs/install-ci/#gitlab.
- node_modules/
# Enables git-lab CI caching. Both .cache and public must be cached, otherwise builds will fail.
- .cache/
- public/
npm:install: # Define a hidden job to be used with extends
stage: build # Better than default to avoid activating cache for all jobs
.dependencies_cache:
cache:
key:
files:
- package-lock.json
paths:
- .npm
policy: pull
setup:
stage: setup
script: script:
- npm ci - npm ci
extends: .dependencies_cache
cache:
policy: pull-push
artifacts:
expire_in: 3 days #delete cache after 3 days to conserve space
paths:
- node_modules
test:unit: test:
stage: test stage: test
needs: ["npm:install"]
script: script:
- npm ci - npm run test:unit
- npm run test:unit \ No newline at end of file
#test:coverage:
# stage: test
# needs: ["npm:install"]
# script:
# - ./node_modules/.bin/gatsby info
# rules:
# - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
# - if: $CI_MERGE_REQUEST_ID
#pages:
# stage: deploy
# needs:
# - npm:install
# - test:unit
# - test:gatsby
# script:
# - ./node_modules/.bin/gatsby build --prefix-paths
# artifacts:
# paths:
# - public
# rules:
# - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment