1- name : static checks
1+ name : PR checks
2+
23on :
3- workflow_dispatch :
4- push :
5- branches :
6- - " master"
74 pull_request :
85 branches :
9- - " *"
6+ - master
7+ - ' v*.*'
108
119jobs :
1210 lint :
@@ -15,57 +13,60 @@ jobs:
1513
1614 steps :
1715 - name : Set up Go
18- uses : actions/setup-go@v4
16+ uses : actions/setup-go@v5
1917 with :
2018 go-version : " ^1.18"
2119
20+ - name : Set up Python
21+ uses : actions/setup-python@v5
22+ with :
23+ python-version : " 3.11"
24+ architecture : " x64"
25+
2226 - name : Checkout repo
23- uses : actions/checkout@v3
27+ uses : actions/checkout@v4
28+
29+ - name : Run linters
30+ run : make lint
31+
2432
2533 unit :
2634 name : Unit Tests with Code coverage
2735 runs-on : ubuntu-20.04
2836
2937 steps :
3038 - name : Set up Go
31- uses : actions/setup-go@v4
39+ uses : actions/setup-go@v5
3240 with :
3341 go-version : " ^1.18"
3442
3543 - name : Checkout Git Repository
36- uses : actions/checkout@v3
37-
38- - name : Run Go Tests
39- run : make test
40-
41- - name : Check format
42- run : |
43- if [[ $(go fmt `go list ./... | grep -v vendor`) ]]; then
44- echo "not well formatted sources are found"
45- exit 1
46- fi
44+ uses : actions/checkout@v4
4745
48- - name : Generate coverage report
46+ - name : Unit Tests with Code Coverage
4947 run : |
50- go test `go list ./... | grep -v examples` -coverprofile=coverage.txt -covermode=atomic
48+ make test
5149
52- - name : Upload coverage report
53- uses : codecov/codecov-action@v1
50+ - name : Upload Code Coverage Report
51+ uses : codecov/codecov-action@v3
5452 with :
55- file : ./coverage.txt
56- flags : unittests
57- name : codecov-umbrella
53+ file : cover.out
54+ verbose : true
55+ fail_ci_if_error : true
56+
57+ source-scan :
58+ name : Gosec code scanning
59+ runs-on : ubuntu-20.04
60+ steps :
61+ - name : Checkout code
62+ uses : actions/checkout@v4
5863
59- - name : Get code coverage artifiact
60- uses : actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
61- with :
62- name : code-coverage
63- - name : Get test result artifact
64- uses : actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
64+ - name : Run gosec
65+ uses : securego/gosec@v2.18.2
6566 with :
66- name : test-results
67- path : test-results
68- - name : Upload code coverage information to codecov.io
69- uses : codecov/codecov -action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
67+ args : ' -no-fail -fmt sarif -out gosec.sarif ./... '
68+
69+ - name : Upload gosec scan results to GitHub Security tab
70+ uses : github/codeql -action/upload-sarif@v2
7071 with :
71- file : coverage.out
72+ sarif_file : ' gosec.sarif '
0 commit comments