]> git.r.bdr.sh - rbdr/cologne/blame_incremental - .gitlab-ci.yml
Use only ref slug for cache
[rbdr/cologne] / .gitlab-ci.yml
... / ...
CommitLineData
1.only-default: &only-default
2 only:
3 - branches
4 - merge_requests
5 - tags
6 - refs
7
8image: node:14
9
10variables:
11 SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
12
13stages:
14 - lint
15 - test
16 - quality
17
18before_script:
19 - npm install
20
21cache:
22 key: ${CI_COMMIT_REF_SLUG}
23 paths:
24 - node_modules/
25 - .nyc_output/
26
27lint:
28 <<: *only-default
29 stage: lint
30 script:
31 - npm run lint
32
33test:
34 <<: *only-default
35 stage: test
36 script:
37 - npm test
38
39quality:
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