]>
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 RBR |
21 | cache: |
22 | key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG" | |
23 | paths: | |
24 | - node_modules/ | |
25 | - .nyc_output/ | |
26 | ||
69d55272 | 27 | lint: |
9fabdd32 | 28 | <<: *only-default |
69d55272 RBR |
29 | stage: lint |
30 | script: | |
31 | - npm run lint | |
32 | ||
33 | test: | |
9fabdd32 | 34 | <<: *only-default |
69d55272 RBR |
35 | stage: test |
36 | script: | |
37 | - npm test | |
7ce5b3cb RBR |
38 | |
39 | quality: | |
59fae9f5 RBR |
40 | stage: quality |
41 | needs: | |
0499d203 | 42 | - test |
7ce5b3cb RBR |
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 |