File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed
Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Go Tests
2+
3+ on :
4+ push :
5+ branches : [ main ]
6+ pull_request :
7+ branches : [ main ]
8+
9+ jobs :
10+ test :
11+ runs-on : ubuntu-latest
12+
13+ steps :
14+ - uses : actions/checkout@v4
15+
16+ - name : Set up Go
17+ uses : actions/setup-go@v5
18+ with :
19+ go-version : ' 1.24'
20+
21+ - name : Cache Go modules
22+ uses : actions/cache@v4
23+ with :
24+ path : ~/go/pkg/mod
25+ key : ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
26+ restore-keys : |
27+ ${{ runner.os }}-go-
28+
29+ - name : Download dependencies
30+ run : go mod download
31+
32+ - name : Run tests
33+ run : go test -v ./...
34+
35+ - name : Run tests with coverage
36+ run : go test -v -coverprofile=coverage.out ./...
37+
38+ - name : Upload coverage to Codecov (optional)
39+ uses : codecov/codecov-action@v4
40+ with :
41+ file : ./coverage.out
42+ flags : unittests
43+ name : codecov-umbrella
44+ fail_ci_if_error : false
You can’t perform that action at this time.
0 commit comments