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