]>
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 | ||
21 | lint: | |
9fabdd32 | 22 | <<: *only-default |
69d55272 RBR |
23 | stage: lint |
24 | script: | |
25 | - npm run lint | |
26 | ||
27 | test: | |
9fabdd32 | 28 | <<: *only-default |
69d55272 | 29 | stage: test |
59fae9f5 RBR |
30 | cache: |
31 | paths: | |
32 | - .nyc_output/ | |
69d55272 RBR |
33 | script: |
34 | - npm test | |
7ce5b3cb RBR |
35 | |
36 | quality: | |
59fae9f5 RBR |
37 | stage: quality |
38 | needs: | |
39 | -test | |
7ce5b3cb RBR |
40 | image: |
41 | name: sonarsource/sonar-scanner-cli:latest | |
42 | entrypoint: [""] | |
43 | cache: | |
44 | key: "${CI_JOB_NAME}" | |
45 | paths: | |
46 | - .sonar/cache | |
47 | script: | |
48 | - npm run coverage | |
49 | - sonar-scanner | |
50 | only: | |
51 | - merge_requests | |
52 | - master |