-
-
Notifications
You must be signed in to change notification settings - Fork 15
93 lines (80 loc) · 2.92 KB
/
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: "Quality"
on:
workflow_dispatch:
schedule:
- cron: '0 8 * * *'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node: [ '20.18.0', '22.11.0' ]
name: "Build"
steps:
- name: "⚙ Set up NodeJS v${{ matrix.node }}"
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: "✅ Checkout repository"
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: "💾 Restore packages from cache"
uses: actions/cache@v4
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: "🦉 GitGuardian scan"
uses: GitGuardian/ggshield-action@master
env:
GITHUB_PUSH_BEFORE_SHA: ${{ github.event.before }}
GITHUB_PUSH_BASE_SHA: ${{ github.event.base }}
GITHUB_PULL_BASE_SHA: ${{ github.event.pull_request.base.sha }}
GITHUB_DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
GITGUARDIAN_API_KEY: ${{ secrets.GITGUARDIAN_API_KEY }}
- name: "📦 Install packages"
run: yarn install
- name: "🔦 Lint"
run: yarn lint
- name: "💅 Lint"
run: yarn build
- name: "👨💻 Run Test"
run: yarn test
env:
NODE_ENV: 'test'
- name: "📊 Publish Test Report"
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: "Test Report (${{ matrix.node }})"
path: './junit.xml'
reporter: jest-junit
- name: "📊 Upload coverage report to Codecov"
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: "📊 SonarCloud Scan"
uses: SonarSource/sonarcloud-github-action@master
with:
args: >
-Dsonar.organization=${{ github.repository_owner }}
-Dsonar.projectKey=${{ github.repository_owner }}_${{ github.event.repository.name }}
-Dsonar.projectName=${{ github.repository_owner }}_${{ github.event.repository.name }}
-Dsonar.projectVersion=1.0
-Dsonar.sourceEncoding=UTF-8
-Dsonar.sources=./src
-Dsonar.exclusions=**/*.bin,node_modules/**,test/**,**/__test__/**,**/__mocks__/**,src/main.ts
-Dsonar.coverage.exclusions=node_modules/**,test/**,**/__test__/**,**/__mocks__/**,src/main.ts
-Dsonar.testExecutionReportPaths=test-report.xml
-Dsonar.javascript.lcov.reportPaths=./coverage/lcov.info
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
#- name: "🦠 Snyk to check for vulnerabilities"
# uses: snyk/actions/node@master
# env:
# SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}