]> git.r.bdr.sh - rbdr/cologne/blob - .gitlab-ci.yml
Move the cache to the global scope
[rbdr/cologne] / .gitlab-ci.yml
1 .only-default: &only-default
2 only:
3 - branches
4 - merge_requests
5 - tags
6 - refs
7
8 image: node:14
9
10 variables:
11 SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
12
13 stages:
14 - lint
15 - test
16 - quality
17
18 before_script:
19 - npm install
20
21 cache:
22 key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
23 paths:
24 - node_modules/
25 - .nyc_output/
26
27 lint:
28 <<: *only-default
29 stage: lint
30 script:
31 - npm run lint
32
33 test:
34 <<: *only-default
35 stage: test
36 script:
37 - npm test
38
39 quality:
40 stage: quality
41 needs:
42 -test
43 image:
44 name: sonarsource/sonar-scanner-cli:latest
45 entrypoint: [""]
46 cache:
47 key: "${CI_JOB_NAME}"
48 paths:
49 - .sonar/cache
50 script:
51 - npm run coverage
52 - sonar-scanner
53 only:
54 - merge_requests
55 - master