File tree Expand file tree Collapse file tree 6 files changed +314
-95
lines changed Expand file tree Collapse file tree 6 files changed +314
-95
lines changed Original file line number Diff line number Diff line change 1
- # See http://docs.codecov.io/docs/coverage-configuration
2
1
coverage :
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
-
11
2
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
20
10
21
- # See http://docs.codecov.io/docs/ignoring-paths
22
11
ignore :
23
12
- " build/*"
24
13
- " hack/*"
25
14
- " openshift-ci/*"
26
15
- " Makefile"
27
16
- " .travis.yml"
28
17
29
- # See http://docs.codecov.io/docs/pull-request-comments-1
30
18
comment :
31
19
layout : " diff, files"
32
20
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
+ lint-go :
31
+ permissions :
32
+ contents : read # for actions/checkout to fetch code
33
+ pull-requests : read # for golangci/golangci-lint-action to fetch pull requests
34
+ name : Lint Go code
35
+ runs-on : ubuntu-latest
36
+ steps :
37
+ - name : Set up Go
38
+
39
+ with :
40
+ go-version : ${{ env.GOLANG_VERSION }}
41
+ - name : Checkout code
42
+ uses : actions/checkout@v4
43
+ - name : Run golangci-lint
44
+ uses : golangci/golangci-lint-action@v3
45
+ with :
46
+ version : v1.53.3
47
+ args : --timeout 6m
48
+ build :
49
+ name : Build
50
+ runs-on : ubuntu-latest
51
+ steps :
52
+ - name : Set up Go
53
+
54
+ with :
55
+ go-version : ${{ env.GOLANG_VERSION }}
56
+ id : go
57
+
58
+ - name : Check out code into the Go module directory
59
+ uses : actions/checkout@v4
60
+
61
+ - name : Restore go build cache
62
+ uses : actions/cache@v4
63
+ with :
64
+ path : ~/.cache/go-build
65
+ key : ${{ runner.os }}-go-build-v1-${{ github.run_id }}
66
+
67
+ - name : Download all Go modules
68
+ run : |
69
+ go mod download
70
+
71
+ - name : Generate code coverage artifacts
72
+ uses : actions/upload-artifact@v4
73
+ with :
74
+ name : code-coverage
75
+ path : coverage.out
76
+
77
+ - name : Upload code coverage information to codecov.io
78
+
79
+ with :
80
+ 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 : " "
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ name : Go Test on Pull Requests
2
+ on :
3
+ pull_request :
4
+ types :
5
+ - opened
6
+ - synchronize
7
+ - reopened
8
+ jobs :
9
+ go :
10
+ name : Check sources
11
+ runs-on : ubuntu-20.04
12
+ env :
13
+ OPERATOR_SDK_VERSION : v1.18.0
14
+ steps :
15
+ - name : Set up Go 1.x
16
+ uses : actions/setup-go@v2
17
+ with :
18
+ go-version : 1.19
19
+ - name : Check out code into the Go module directory
20
+ uses : actions/checkout@v2
21
+ with :
22
+ fetch-depth : 0
23
+ - name : Upload coverage to Codecov
24
+ uses : codecov/codecov-action@v3
25
+ docker :
26
+ name : Check docker build
27
+ runs-on : ubuntu-20.04
28
+ steps :
29
+ - name : Check out code into the Go module directory
30
+ uses : actions/checkout@v2
31
+ with :
32
+ fetch-depth : 0
33
+ - name : Check if dockerimage build is working
34
+ run : docker build -f ./Dockerfile .
35
+ gitlint :
36
+ name : Run gitlint checks
37
+ runs-on : ubuntu-20.04
38
+ steps :
39
+ - name : Check out code
40
+ uses : actions/checkout@v2
41
+ with :
42
+ fetch-depth : 0
43
+ ref : ${{ github.event.pull_request.head.sha }}
44
+ - name : Install gitlint into container
45
+ run : python -m pip install gitlint
46
+ - name : Run gitlint check
47
+ run : gitlint --commits origin/${{ github.event.pull_request.base.ref }}..HEAD
You can’t perform that action at this time.
0 commit comments