10
10
fail-fast : false
11
11
matrix :
12
12
os : [ "ubuntu", "windows", "macos" ]
13
- go : [ "1.15.x", "1.16.x" ]
13
+ go : [ "1.16.x", "1.17.x" ]
14
+ env :
15
+ COVERAGES : " "
14
16
runs-on : ${{ matrix.os }}-latest
15
17
name : ${{ matrix.os}} (go ${{ matrix.go }})
16
18
steps :
@@ -24,24 +26,30 @@ jobs:
24
26
run : |
25
27
go version
26
28
go env
29
+ - name : Run repo-specific setup
30
+ uses : ./.github/actions/go-test-setup
31
+ if : hashFiles('./.github/actions/go-test-setup') != ''
27
32
- name : Run tests
28
- uses : protocol/multiple-go-modules@v1.0
33
+ uses : protocol/multiple-go-modules@v1.2
29
34
with :
30
- run : go test -v -coverprofile coverage.txt ./...
35
+ run : go test -v -coverprofile module- coverage.txt ./...
31
36
- name : Run tests (32 bit)
32
37
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
34
39
env :
35
40
GOARCH : 386
36
41
with :
37
42
run : go test -v ./...
38
43
- name : Run tests with race detector
39
44
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
41
46
with :
42
47
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
43
51
- name : Upload coverage to Codecov
44
- uses : codecov/codecov-action@a1ed4b322b4b38cb846afb5a0ebfa17086917d27 # v1.5.0
52
+ uses : codecov/codecov-action@51d810878be5422784e86451c0e7c14e5860ec47 # v2.0.2
45
53
with :
46
- file : coverage.txt
54
+ files : ' ${{ env.COVERAGES }} '
47
55
env_vars : OS=${{ matrix.os }}, GO=${{ matrix.go }}
0 commit comments