@@ -10,15 +10,17 @@ jobs:
10
10
fail-fast : false
11
11
matrix :
12
12
os : [ "ubuntu", "windows", "macos" ]
13
- go : [ "1.18 .x", "1.19 .x" ]
13
+ go : ["1.19 .x","1.20 .x"]
14
14
env :
15
15
COVERAGES : " "
16
- runs-on : ${{ format('{0}-latest', matrix.os) }}
16
+ runs-on : ${{ fromJSON(vars[ format('UCI_GO_TEST_RUNNER_ {0}', matrix.os)] || format('"{0} -latest" ', matrix.os) ) }}
17
17
name : ${{ matrix.os }} (go ${{ matrix.go }})
18
18
steps :
19
19
- uses : actions/checkout@v3
20
20
with :
21
21
submodules : recursive
22
+ - id : config
23
+ uses : protocol/.github/.github/actions/read-config@master
22
24
- uses : actions/setup-go@v3
23
25
with :
24
26
go-version : ${{ matrix.go }}
27
29
go version
28
30
go env
29
31
- name : Use msys2 on windows
30
- if : ${{ matrix.os == 'windows' }}
32
+ if : matrix.os == 'windows'
31
33
shell : bash
32
34
# The executable for msys2 is also called bash.cmd
33
35
# https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md#shells
@@ -38,31 +40,37 @@ jobs:
38
40
uses : ./.github/actions/go-test-setup
39
41
if : hashFiles('./.github/actions/go-test-setup') != ''
40
42
- name : Run tests
43
+ if : contains(fromJSON(steps.config.outputs.json).skipOSes, matrix.os) == false
41
44
42
45
with :
43
46
# Use -coverpkg=./..., so that we include cross-package coverage.
44
47
# If package ./A imports ./B, and ./A's tests also cover ./B,
45
48
# this means ./B's coverage will be significantly higher than 0%.
46
49
run : go test -v -shuffle=on -coverprofile=module-coverage.txt -coverpkg=./... ./...
47
50
- name : Run tests (32 bit)
48
- if : ${{ matrix.os != 'macos' }} # can't run 32 bit tests on OSX.
51
+ # can't run 32 bit tests on OSX.
52
+ if : matrix.os != 'macos' &&
53
+ fromJSON(steps.config.outputs.json).skip32bit != true &&
54
+ contains(fromJSON(steps.config.outputs.json).skipOSes, matrix.os) == false
49
55
50
56
env :
51
57
GOARCH : 386
52
58
with :
53
59
run : |
54
- export "PATH=${{ env. PATH_386 }} :$PATH"
60
+ export "PATH=$PATH_386:$PATH"
55
61
go test -v -shuffle=on ./...
56
62
- name : Run tests with race detector
57
- if : ${{ matrix.os == 'ubuntu' }} # speed things up. Windows and OSX VMs are slow
63
+ # speed things up. Windows and OSX VMs are slow
64
+ if : matrix.os == 'ubuntu' &&
65
+ contains(fromJSON(steps.config.outputs.json).skipOSes, matrix.os) == false
58
66
59
67
with :
60
68
run : go test -v -race ./...
61
69
- name : Collect coverage files
62
70
shell : bash
63
71
run : echo "COVERAGES=$(find . -type f -name 'module-coverage.txt' | tr -s '\n' ',' | sed 's/,$//')" >> $GITHUB_ENV
64
72
- name : Upload coverage to Codecov
65
- uses : codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0
73
+ uses : codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1
66
74
with :
67
75
files : ' ${{ env.COVERAGES }}'
68
76
env_vars : OS=${{ matrix.os }}, GO=${{ matrix.go }}
0 commit comments