-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Collect test coverage from the proper version of Go (#33)
- Loading branch information
Showing
2 changed files
with
46 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ jobs: | |
gotest: | ||
strategy: | ||
matrix: | ||
go-version: [1.21.x, 1.22.x, 1.23.0-rc.2] | ||
go-version: [1.21.x, 1.23.x] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
@@ -20,22 +20,24 @@ jobs: | |
with: | ||
go-version: ${{ matrix.go-version }} | ||
|
||
- name: Cache go packages | ||
uses: actions/cache@v4 | ||
- name: Run tests | ||
run: go test -race ./... | ||
|
||
|
||
coverage: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-go@v5 | ||
with: | ||
path: | | ||
~/go/pkg/mod | ||
~/.cache/go-build | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}- | ||
${{ runner.os }}-go- | ||
go-version: '1.23.x' | ||
|
||
- name: Run tests | ||
run: go test -race ./... | ||
run: go test ./... | ||
|
||
- name: Run coverage | ||
run: go test -coverprofile=coverage.out -covermode=atomic ./... | ||
run: go test -coverprofile=coverage.out -covermode=atomic $(go list ./... | grep -v internal/th) | ||
|
||
- name: Upload coverage reports to Codecov | ||
uses: codecov/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters