forked from moby/buildkit
-
Notifications
You must be signed in to change notification settings - Fork 2
143 lines (136 loc) · 3.52 KB
/
test-os.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
name: test-os
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
schedule:
- cron: '0 10 * * *'
workflow_dispatch:
push:
branches:
- 'master'
- 'v[0-9]+.[0-9]+'
pull_request:
paths-ignore:
- 'README.md'
- 'docs/**'
- 'frontend/dockerfile/docs/**'
env:
GO_VERSION: "1.20"
TESTFLAGS: "-v --parallel=6 --timeout=30m"
GOTESTSUM_VERSION: "v1.9.0" # same as one in Dockerfile
GOTESTSUM_FORMAT: "standard-verbose"
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
# - ubuntu-22.04
# - macOS-11
- windows-2022
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "${{ env.GO_VERSION }}"
-
name: Install gotestsum
run: |
go install gotest.tools/gotestsum@${{ env.GOTESTSUM_VERSION }}
-
name: Test
env:
TMPDIR: ${{ runner.temp }}
SKIP_INTEGRATION_TESTS: 1
run: |
mkdir -p ./bin/testreports
gotestsum \
--jsonfile="./bin/testreports/go-test-report.json" \
--junitfile="./bin/testreports/junit-report.xml" \
--packages="./..." \
-- \
"-mod=vendor" \
"-coverprofile" "./bin/testreports/coverage.txt" \
"-covermode" "atomic" ${TESTFLAGS}
shell: bash
-
name: Send to Codecov
if: always()
uses: codecov/codecov-action@v3
with:
directory: ./bin/testreports
env_vars: RUNNER_OS
flags: unit
-
name: Generate annotations
if: always()
uses: crazy-max/.github/.github/actions/gotest-annotations@5af0882e0496d2f7e98a53ae4048e3d86682496f
with:
directory: ./bin/testreports
-
name: Upload test reports
if: always()
uses: actions/upload-artifact@v3
with:
name: test-reports
path: ./bin/testreports
-
name: Dump context
if: failure()
uses: crazy-max/ghaction-dump-context@v2
test-freebsd-amd64:
runs-on: macos-12
env:
VAGRANT_VAGRANTFILE: hack/Vagrantfile.freebsd13
GOOS: freebsd
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "${{ env.GO_VERSION }}"
- name: Build buildkitd binary
run: |
go build ./cmd/buildkitd
- name: Build buildctl binary
run: |
go build ./cmd/buildctl
-
name: Cache Vagrant boxes
uses: actions/cache@v3
with:
path: ~/.vagrant.d/boxes
key: ${{ runner.os }}-vagrant-${{ hashFiles('hack/Vagrantfile.freebsd13') }}
restore-keys: |
${{ runner.os }}-vagrant-
-
name: Set up vagrant
run: |
vagrant up --no-tty
-
name: Smoke test
run: |
vagrant up --provision-with=test-smoke
-
name: BuildKit logs
if: always()
run: |
vagrant ssh -- "sudo cat /vagrant/.tmp/logs/buildkitd"
-
name: Containerd logs
if: always()
run: |
vagrant ssh -- "sudo cat /vagrant/.tmp/logs/containerd"
-
name: Dump context
if: failure()
uses: crazy-max/ghaction-dump-context@v2