-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (42 loc) · 1.15 KB
/
backend-api-push-to-main.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
name: Async-credential Push to Main
on:
push:
branches:
- main
paths:
- "backend-api/**"
- ".github/workflows/backend-api-push-to-main.yml"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
permissions:
contents: read
jobs:
sonar-scan:
name: Sonar main branch scan
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: backend-api
steps:
- name: Check out repository code
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: Setup nodeJS v20
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: backend-api/package-lock.json
- name: Install dependencies
run: npm install
# Generate test coverage report for Sonar main branch analysis
- name: Run Tests
run: npm run test
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}