-
Notifications
You must be signed in to change notification settings - Fork 30
54 lines (47 loc) · 1.15 KB
/
unit-tests.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
name: Unit Tests
on:
push:
branches:
- main
- v[0-9]+.[0-9]+
pull_request:
branches:
- main
- v[0-9]+.[0-9]+
jobs:
tests:
runs-on: ubuntu-latest
name: Unit Tests
steps:
- name: Checkout the repo
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all tags and branches
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Unit tests
run: make test
- name: Test Coverage and Report Generation
run: |
make test-coverage | tee report_unit.json
make gosec-scan
cat gosec.json
- name: Store the GitHub triggering event for the sonarcloud workflow
if: |
github.repository_owner == 'stolostron'
run: |
cat <<EOF > event.json
${{ toJSON(github.event) }}
EOF
- name: Upload artifacts for the sonarcloud workflow
if: |
github.repository_owner == 'stolostron'
uses: actions/upload-artifact@v4
with:
name: artifacts
path: |
coverage*.out
event.json
gosec.json