-
Notifications
You must be signed in to change notification settings - Fork 6
93 lines (79 loc) · 2.47 KB
/
go.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: Go
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Cancel running workflows on new push to a PR.
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
tidy:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [ '1.20' ]
steps:
- uses: actions/checkout@v4
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: tidy
run: |
go mod tidy
go mod verify
git status
if [[ -n "$(git status --porcelain .)" ]]; then
echo 'go.mod/go.sum is out-of-date: run `go mod tidy` in the right module directories (see git status) and then check in the changes'
echo 'If `go mod tidy` results in no changes, make sure you are using the latest relase of Go'
git status --porcelain .
exit 1
fi
- name: gofmt
run: test -z "$(gofmt -s -l $(find -name '*.go'))"
build:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [ '1.20', '1.21.x' ]
steps:
- uses: actions/checkout@v4
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Build
run: go build ./...
- name: Build tools
run: cd ./tools/runvmtest && go build
test:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [ '1.20', '1.21.x' ]
arch: [ 'amd64', 'arm', 'arm64', 'riscv64' ]
exclude:
# TODO: QEMU tests seem to time out.
- go-version: 1.21.x
arch: arm
steps:
- uses: actions/checkout@v4
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Build runvm tool
run: (cd ./tools/runvmtest && go build)
- name: Test
run: |
VMTEST_ARCH=${{ matrix.arch }} ./tools/runvmtest/runvmtest -- \
go test -v -coverprofile=coverage.txt -covermode=atomic -coverpkg=./... ./...
- uses: codecov/codecov-action@v4-beta
env:
CODECOV_TOKEN: '6793138f-7113-4561-aa24-08bdd9111678'
with:
flags: ${{ matrix.arch }}-${{ matrix.go-version }}
fail_ci_if_error: true
verbose: true