-
Notifications
You must be signed in to change notification settings - Fork 9
46 lines (41 loc) · 1.27 KB
/
frontend_sonar_scan.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: SonarQube Static Analysis
on:
push:
paths:
- govtool/frontend/**
- .github/workflows/frontend_sonar_scan.yml
jobs:
execute_sonar_scanner:
name: Execute sonar-scanner on govtool frontend
runs-on: ubuntu-latest
permissions: read-all
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Cache dependencies
uses: actions/cache@v2
with:
path: govtool/frontend/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('govtool/frontend/package-lock.json') }}
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: "govtool/frontend/.nvmrc"
registry-url: "https://registry.npmjs.org/"
scope: "@intersect.mbo"
- name: 🧪 Test
working-directory: govtool/frontend
env:
NODE_OPTIONS: "--max_old_space_size=6144"
NODE_AUTH_TOKEN: ${{ secrets.NPMRC_TOKEN }}
run: |
npm ci
npm run test:coverage
- uses: sonarsource/sonarqube-scan-action@master
if: always()
with:
projectBaseDir: govtool/frontend
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: https://sonarcloud.io