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