-
Notifications
You must be signed in to change notification settings - Fork 6
54 lines (44 loc) · 1.12 KB
/
sonarcloud.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
47
48
49
50
51
52
53
54
name: "Sonar Cloud Workflow"
on:
push:
branches:
- main
- dev
paths:
- 'src/**'
- 'package.json'
- 'Dockerfile'
workflow_call:
secrets:
SONAR_TOKEN:
required: true
jobs:
Analysis:
name: Analyse
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 16.x ]
steps:
- uses: actions/checkout@v2
# Add this step to remove the cache
- name: Clear cache
run: |
rm -rf node_modules
rm -f package-lock.json
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Run npm install
run: npm install --legacy-peer-deps
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: npm run coverage
- name: Test
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}