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