Skip to content

Commit af3ae0d

Browse files
committed
update .github/workflows/go-test.yml
1 parent 90653a1 commit af3ae0d

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

.github/workflows/go-test.yml

+15-7
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ jobs:
1010
fail-fast: false
1111
matrix:
1212
os: [ "ubuntu", "windows", "macos" ]
13-
go: [ "1.15.x", "1.16.x" ]
13+
go: [ "1.16.x", "1.17.x" ]
14+
env:
15+
COVERAGES: ""
1416
runs-on: ${{ matrix.os }}-latest
1517
name: ${{ matrix.os}} (go ${{ matrix.go }})
1618
steps:
@@ -24,24 +26,30 @@ jobs:
2426
run: |
2527
go version
2628
go env
29+
- name: Run repo-specific setup
30+
uses: ./.github/actions/go-test-setup
31+
if: hashFiles('./.github/actions/go-test-setup') != ''
2732
- name: Run tests
28-
uses: protocol/multiple-go-modules@v1.0
33+
uses: protocol/multiple-go-modules@v1.2
2934
with:
30-
run: go test -v -coverprofile coverage.txt ./...
35+
run: go test -v -coverprofile module-coverage.txt ./...
3136
- name: Run tests (32 bit)
3237
if: ${{ matrix.os != 'macos' }} # can't run 32 bit tests on OSX.
33-
uses: protocol/multiple-go-modules@v1.0
38+
uses: protocol/multiple-go-modules@v1.2
3439
env:
3540
GOARCH: 386
3641
with:
3742
run: go test -v ./...
3843
- name: Run tests with race detector
3944
if: ${{ matrix.os == 'ubuntu' }} # speed things up. Windows and OSX VMs are slow
40-
uses: protocol/multiple-go-modules@v1.0
45+
uses: protocol/multiple-go-modules@v1.2
4146
with:
4247
run: go test -v -race ./...
48+
- name: Collect coverage files
49+
shell: bash
50+
run: echo "COVERAGES=$(find . -type f -name 'module-coverage.txt' | tr -s '\n' ',' | sed 's/,$//')" >> $GITHUB_ENV
4351
- name: Upload coverage to Codecov
44-
uses: codecov/codecov-action@a1ed4b322b4b38cb846afb5a0ebfa17086917d27 # v1.5.0
52+
uses: codecov/codecov-action@51d810878be5422784e86451c0e7c14e5860ec47 # v2.0.2
4553
with:
46-
file: coverage.txt
54+
files: '${{ env.COVERAGES }}'
4755
env_vars: OS=${{ matrix.os }}, GO=${{ matrix.go }}

0 commit comments

Comments
 (0)