Skip to content
Snippets Groups Projects

Amélioration de la pipeline

Merged MARTIN Pierre-Alexandre requested to merge devs/pipeline into dev
Files
2
+ 48
0
# source: https://stackoverflow.com/questions/55359804/gitlab-ci-npm-doesnt-like-the-cached-node-modules
image: node:22
stages:
- build
- test
cache:
- &global_cache_node_mods
key:
files:
- package-lock.json
paths:
- node_modules/
policy: pull # prevent subsequent jobs from modifying cache
variables:
NUXT_ENV: production
install:
stage: .pre # always first, no matter if it is listed in stages
cache:
- <<: *global_cache_node_mods
when: on_success
policy: pull-push
- key: ${CI_JOB_NAME}
paths:
- .npm/
when: on_success
policy: pull-push
script:
- npm ci --cache .npm --prefer-offline
build:
stage: build
script:
@@ -13,4 +38,27 @@ build:
- npm run build
artifacts:
paths:
- .nuxt/
- .output/
test:
stage: test
needs:
- job: build
artifacts: true # grabs built files
script:
- npm run test
artifacts:
when: always
paths:
- .nuxt/tests/vitest-junit-report.xml
reports:
junit: .nuxt/tests/vitest-junit-report.xml
lint:
stage: test
needs:
- job: build
artifacts: true
script:
- npm run lint
Loading