-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (46 loc) · 1.42 KB
/
check_quality.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: Check code quality
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
codecovAndSonarcloud:
runs-on: ubuntu-latest
steps:
- name: 1/7 | Checkout repo
uses: actions/checkout@v4
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
- name: 2/7 | Setup Node environment
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: 3/7 | Setup MongoDB test instance
uses: supercharge/[email protected]
with:
mongodb-version: '6.0'
- name: 4/7 | Install depedencies
run: npm ci
- name: 5/7 | Run unit tests suite
run: npm run test:ci
env:
PORT: ${{ vars.ACTION_PORT }}
CONNECTION_URL: ${{ vars.ACTION_CONNECTION_URL }}
JWT_SECRET: ${{ vars.ACTION_JWT_SECRET }}
CRYPT_SECRET: ${{ vars.ACTION_CRYPT_SECRET }}
CRYPT_METH: ${{ vars.ACTION_CRYPT_METH }}
- name: 6/7 | Run Codecov Uploader
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage/coverage-final.json
flags: unittests
fail_ci_if_error: true
verbose: true
- name: 7/7 | Run SonarCloud Scanner
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}