File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- # See http://docs.codecov.io/docs/coverage-configuration
21coverage :
3- precision : 2 # 2 = xx.xx%, 0 = xx%
4- round : down
5- # For example: 20...60 would result in any coverage less than 20%
6- # would have a red background. The color would gradually change to
7- # green approaching 60%. Any coverage over 60% would result in a
8- # solid green color.
9- range : " 20...60"
10-
112 status :
12- # project will give us the diff in the total code coverage between a commit
13- # and its parent
14- project : yes
15- # Patch gives just the coverage of the patch
16- patch : yes
17- # changes tells us if there are unexpected code co verage changes in other files
18- # which were not changed by the diff
19- changes : yes
3+ # allow test coverage to drop by 0.1%, assume that it's typically due to CI problems
4+ patch :
5+ default :
6+ threshold : 0.1
7+ project :
8+ default :
9+ threshold : 0.1
2010
21- # See http://docs.codecov.io/docs/ignoring-paths
2211 ignore :
2312 - " build/*"
2413 - " hack/*"
2514 - " openshift-ci/*"
2615 - " Makefile"
2716 - " .travis.yml"
2817
29- # See http://docs.codecov.io/docs/pull-request-comments-1
3018comment :
3119 layout : " diff, files"
3220 behavior : " "
33- # default = posts once then update, posts new if delete
34- # once = post once then updates
35- # new = delete old, post new
36- # spammy = post new
Original file line number Diff line number Diff line change 1+ name : Go
2+ on :
3+ push :
4+ branches :
5+ - " master"
6+ pull_request :
7+ branches :
8+ - " master"
9+ env :
10+ # Golang version to use across CI steps
11+ GOLANG_VERSION : ' 1.20'
12+
13+ concurrency :
14+ group : ${{ github.workflow }}-${{ github.ref }}
15+ cancel-in-progress : true
16+
17+ permissions :
18+ contents : read
19+
20+ jobs :
21+ event_file :
22+ name : " Event File"
23+ runs-on : ubuntu-latest
24+ steps :
25+ - name : Upload
26+ uses : actions/upload-artifact@v4
27+ with :
28+ name : Event File
29+ path : ${{ github.event_path }}
30+
31+ build :
32+ name : Build
33+ runs-on : ubuntu-latest
34+ steps :
35+ - name : Set up Go
36+ uses : actions/setup-go@v5.0.0
37+ with :
38+ go-version : ${{ env.GOLANG_VERSION }}
39+ id : go
40+
41+ - name : Check out code into the Go module directory
42+ uses : actions/checkout@v4
43+
44+ - name : Restore go build cache
45+ uses : actions/cache@v4
46+ with :
47+ path : ~/.cache/go-build
48+ key : ${{ runner.os }}-go-build-v1-${{ github.run_id }}
49+
50+ - name : Download all Go modules
51+ run : |
52+ go mod download
53+
54+ - name : Generate code coverage artifacts
55+ uses : actions/upload-artifact@v4
56+ with :
57+ name : code-coverage
58+ path : coverage.out
59+
60+ - name : Upload code coverage information to codecov.io
61+ uses : codecov/codecov-action@v3.1.4
62+ with :
63+ file : coverage.out
Original file line number Diff line number Diff line change 1+ ---
2+ name : Go Test on Pull Requests
3+ on : # yamllint disable-line rule:truthy
4+ pull_request :
5+ types :
6+ - opened
7+ - synchronize
8+ - reopened
9+ paths :
10+ - ' **.go'
11+ workflow_dispatch :
12+ jobs :
13+ gosec :
14+ name : Check GO security
15+ runs-on : ubuntu-20.04
16+ steps :
17+ - name : Check out code
18+ uses : actions/checkout@v3
19+ with :
20+ fetch-depth : 1
21+ ref : ${{ github.event.pull_request.head.sha }}
22+ - name : Run Gosec Security Scanner
23+ uses : securego/gosec@master
24+ with :
25+ args : -exclude-generated ./...
26+ env :
27+ GOROOT : " "
Original file line number Diff line number Diff line change 44 pull_request :
55 branches :
66 - master
7- - ' v*.*'
7+
8+ env :
9+ GO111MODULE : on
10+ SDK_VERSION : " 1.17.0"
11+ MINIKUBE_WANTUPDATENOTIFICATION : false
12+ MINIKUBE_WANTREPORTERRORPROMPT : false
13+ K8S_VERSION : " 1.21.3"
14+ MINIKUBE_VERSION : " 1.26.0"
15+ OLM_VERSION : " 0.22.0"
16+ TEST_ACCEPTANCE_CLI : " kubectl"
17+ TEST_RESULTS : " out/acceptance-tests"
818
919jobs :
1020 lint :
2636 - name : Checkout repo
2737 uses : actions/checkout@v4
2838
29- - name : Run linters
30- run : make lint
31-
32-
3339 unit :
3440 name : Unit Tests with Code coverage
3541 runs-on : ubuntu-20.04
@@ -44,29 +50,11 @@ jobs:
4450 uses : actions/checkout@v4
4551
4652 - name : Unit Tests with Code Coverage
47- run : |
48- make test
53+ run : ./scripts/openshiftci-presubmit-unittests.sh
4954
5055 - name : Upload Code Coverage Report
5156 uses : codecov/codecov-action@v3
5257 with :
5358 file : cover.out
5459 verbose : true
5560 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
63-
64- - name : Run gosec
65- uses : securego/gosec@v2.18.2
66- with :
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
71- with :
72- sarif_file : ' gosec.sarif'
You can’t perform that action at this time.
0 commit comments