-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (39 loc) · 1.11 KB
/
sonarcloud.yml
File metadata and controls
48 lines (39 loc) · 1.11 KB
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
name: SonarCloud
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
analyze:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use Node 20
uses: actions/setup-node@v4
with:
node-version: 20
# ---- FRONT END (React in front_end/)
- name: Install FE deps
working-directory: front_end
run: npm ci
- name: FE tests (coverage)
working-directory: front_end
run: |
npm test -- --coverage --watchAll=false || echo "no FE tests"
# ---- BACK END (Node/Express in back_end/)
- name: Install BE deps
working-directory: back_end
run: npm ci
- name: BE tests (coverage)
working-directory: back_end
run: |
npm test -- --coverage --watchAll=false || echo "no BE tests"
- name: SonarCloud scan
uses: SonarSource/sonarcloud-github-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}