]>
Commit | Line | Data |
---|---|---|
6a4e7000 RBR |
1 | .only-default: &only-default |
2 | only: | |
3 | - branches | |
4 | - merge_requests | |
5 | - tags | |
6 | - refs | |
7 | ||
2a9da17f RBR |
8 | image: node:14 |
9 | ||
56cee367 RBR |
10 | variables: |
11 | SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache | |
12 | ||
2a9da17f RBR |
13 | stages: |
14 | - lint | |
15 | - test | |
56cee367 | 16 | - quality |
2a9da17f RBR |
17 | |
18 | before_script: | |
19 | - npm install | |
20 | ||
b9c7f5bf | 21 | cache: |
827c56a9 | 22 | key: ${CI_COMMIT_REF_SLUG} |
b9c7f5bf RBR |
23 | paths: |
24 | - node_modules/ | |
25 | - .nyc_output/ | |
d959613c | 26 | - .sonar/cache |
b9c7f5bf | 27 | |
2a9da17f | 28 | lint: |
6a4e7000 | 29 | <<: *only-default |
2a9da17f RBR |
30 | stage: lint |
31 | script: | |
32 | - npm run lint | |
33 | ||
34 | test: | |
6a4e7000 | 35 | <<: *only-default |
2a9da17f RBR |
36 | stage: test |
37 | script: | |
38 | - npm test | |
56cee367 RBR |
39 | |
40 | quality: | |
b8778db9 RBR |
41 | stage: quality |
42 | needs: | |
238047e1 | 43 | - test |
56cee367 RBR |
44 | image: |
45 | name: sonarsource/sonar-scanner-cli:latest | |
46 | entrypoint: [""] | |
56cee367 RBR |
47 | script: |
48 | - npm run coverage | |
49 | - sonar-scanner | |
50 | only: | |
51 | - merge_requests | |
52 | - master |