-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (37 loc) · 1.07 KB
/
Copy pathsonarcloud.yml
File metadata and controls
45 lines (37 loc) · 1.07 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
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
# FRONTEND (adjust path if needed)
- name: Install FE deps
working-directory: frontend
run: npm ci
- name: FE tests (coverage)
working-directory: frontend
run: npm test -- --coverage --watchAll=false || echo "no FE tests"
# BACKEND (adjust path if needed)
- name: Install BE deps
working-directory: backend
run: npm ci
- name: BE tests (coverage)
working-directory: backend
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 }}