-
Notifications
You must be signed in to change notification settings - Fork 114
295 lines (279 loc) · 9.44 KB
/
tests.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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
name: Tests
on:
push:
branches:
- main
pull_request:
env:
DOCKER_BUILDKIT: 1
jobs:
build:
runs-on: ubuntu-22.04
name: Build
steps:
- uses: actions/checkout@v4
- name: Build all
run: ./script/util/make.sh build -j2
test:
runs-on: ubuntu-22.04
name: Test
steps:
- uses: actions/checkout@v4
- name: Test all
run: ./script/util/make.sh test-all -j2
linter:
runs-on: ubuntu-22.04
name: Linter
strategy:
fail-fast: false
matrix:
targetdir: [".", "./estargz", "./cmd", "./ipfs"]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- uses: actions/setup-go@v5
with:
go-version: '1.22.x'
- name: golangci-lint
uses: golangci/golangci-lint-action@v6.0.1
with:
version: v1.59.1
args: --verbose --timeout=10m
working-directory: ${{ matrix.targetdir }}
integration:
runs-on: ubuntu-22.04
name: Integration
strategy:
fail-fast: false
matrix:
# Temporary disable containerd main branch test and migrate to containerd v2 after it's released.
# buildargs: ["", "--build-arg=CONTAINERD_VERSION=main"] # released version & main version
buildargs: [""]
builtin: ["true", "false"]
metadata-store: ["memory", "db"]
exclude:
# - buildargs: ""
# builtin: "true"
- metadata-store: "db"
builtin: "true"
# - metadata-store: "db"
# buildargs: "--build-arg=CONTAINERD_VERSION=main"
steps:
- name: Install htpasswd for setting up private registry
run: sudo apt-get update -y && sudo apt-get --no-install-recommends install -y apache2-utils
- uses: actions/checkout@v4
- name: Run integration test
env:
DOCKER_BUILD_ARGS: ${{ matrix.buildargs }}
BUILTIN_SNAPSHOTTER: ${{ matrix.builtin }}
METADATA_STORE: ${{ matrix.metadata-store }}
run: make integration
test-optimize:
runs-on: ubuntu-22.04
name: Optimize
strategy:
fail-fast: false
matrix:
# Temporary disable contaienrd main branch test and migrate to containerd v2 after it's released.
# buildargs: ["", "--build-arg=CONTAINERD_VERSION=main"] # released version & main version
buildargs: [""]
steps:
- name: Install htpasswd for setting up private registry
run: sudo apt-get update -y && sudo apt-get --no-install-recommends install -y apache2-utils
- uses: actions/checkout@v4
- name: Run test for optimize subcommand of ctr-remote
env:
DOCKER_BUILD_ARGS: ${{ matrix.buildargs }}
run: make test-optimize
test-kind:
runs-on: ubuntu-22.04
name: Kind
strategy:
fail-fast: false
matrix:
# Temporary disable contaienrd main branch test and migrate to containerd v2 after it's released.
# buildargs: ["", "--build-arg=CONTAINERD_VERSION=main"] # released version & main version
buildargs: [""]
builtin: ["true", "false"]
# exclude:
# - buildargs: ""
# builtin: "true"
steps:
- name: Install htpasswd for setting up private registry
run: sudo apt-get update -y && sudo apt-get --no-install-recommends install -y apache2-utils
- uses: actions/checkout@v4
- name: Run test for pulling image from private registry on Kubernetes
env:
DOCKER_BUILD_ARGS: ${{ matrix.buildargs }}
BUILTIN_SNAPSHOTTER: ${{ matrix.builtin }}
run: make test-kind
test-criauth:
runs-on: ubuntu-22.04
name: CRIAuth
strategy:
fail-fast: false
matrix:
# Temporary disable contaienrd main branch test and migrate to containerd v2 after it's released.
# buildargs: ["", "--build-arg=CONTAINERD_VERSION=main"] # released version & main version
buildargs: [""]
builtin: ["true", "false"]
# exclude:
# - buildargs: ""
# builtin: "true"
steps:
- name: Install htpasswd for setting up private registry
run: sudo apt-get update -y && sudo apt-get --no-install-recommends install -y apache2-utils
- uses: actions/checkout@v4
- name: Run test for pulling image from private registry on Kubernetes with CRI keychain mode
env:
DOCKER_BUILD_ARGS: ${{ matrix.buildargs }}
BUILTIN_SNAPSHOTTER: ${{ matrix.builtin }}
run: make test-criauth
test-cri-containerd:
runs-on: ubuntu-22.04
name: CRIValidationContainerd
strategy:
fail-fast: false
matrix:
# Temporary disable contaienrd main branch test and migrate to containerd v2 after it's released.
# buildargs: ["", "--build-arg=CONTAINERD_VERSION=main"] # released version & main version
buildargs: [""]
builtin: ["true", "false"]
metadata-store: ["memory", "db"]
exclude:
# - buildargs: ""
# builtin: "true"
- metadata-store: "db"
builtin: "true"
# - metadata-store: "db"
# buildargs: "--build-arg=CONTAINERD_VERSION=main"
steps:
- uses: actions/checkout@v4
- name: Validate containerd through CRI
env:
DOCKER_BUILD_ARGS: ${{ matrix.buildargs }}
BUILTIN_SNAPSHOTTER: ${{ matrix.builtin }}
METADATA_STORE: ${{ matrix.metadata-store }}
run: make test-cri-containerd
test-cri-cri-o:
runs-on: ubuntu-22.04
name: CRIValidationCRIO
strategy:
fail-fast: false
matrix:
metadata-store: ["memory", "db"]
steps:
- name: Install the latest docker
run: |
sudo apt-get remove moby-cli moby-engine
wget -O get-docker.sh https://get.docker.com
sh get-docker.sh
- uses: actions/checkout@v4
- name: Validate CRI-O through CRI
env:
DOCKER_BUILD_ARGS: "--build-arg=RUNC_VERSION=v1.0.3"
METADATA_STORE: ${{ matrix.metadata-store }}
run: |
# needed to pass "runtime should output OOMKilled reason" test
sudo swapoff -a
make test-cri-o
test-podman:
runs-on: ubuntu-22.04
name: PodmanRootless
steps:
- uses: actions/checkout@v4
- name: Test Podman (rootless)
run: make test-podman
test-k3s:
runs-on: ubuntu-22.04
name: K3S
steps:
- uses: actions/setup-go@v5
with:
go-version: '1.22.x'
- name: Install k3d
run: |
wget -q -O - https://raw.githubusercontent.com/rancher/k3d/v5.6.3/install.sh | bash
- name: Install htpasswd for setting up private registry
run: sudo apt-get update -y && sudo apt-get --no-install-recommends install -y apache2-utils
- name: Install yq
run: |
sudo wget -O /usr/local/bin/yq https://github.com/mikefarah/yq/releases/download/v4.9.3/yq_linux_amd64
sudo chmod +x /usr/local/bin/yq
- uses: actions/checkout@v4
- name: Run test with k3s
run: make test-k3s
test-ipfs:
runs-on: ubuntu-22.04
name: IPFS
steps:
- uses: actions/checkout@v4
- name: Run test
run: make test-ipfs
test-k3s-argo-workflow:
runs-on: ubuntu-22.04
name: K3SArgoWorkflow
env:
RESULT_DIR: ${{ github.workspace }}/argo-workflow/
steps:
- uses: actions/setup-go@v5
with:
go-version: '1.22.x'
- name: Install k3d
run: |
wget -q -O - https://raw.githubusercontent.com/rancher/k3d/v5.6.3/install.sh | bash
- name: Install argo worklflow
run: |
wget -q https://github.com/argoproj/argo-workflows/releases/download/v3.0.10/argo-linux-amd64.gz
gunzip argo-linux-amd64.gz
sudo mv argo-linux-amd64 /usr/local/bin/argo
sudo chmod +x /usr/local/bin/argo
- name: Workaround for freeing up more disk space
# https://github.com/actions/runner-images/issues/2606
run: |
sudo rm -rf /usr/local/lib/android # will release about 10 GB if you don't need Android
sudo rm -rf /usr/share/dotnet # will release about 20GB if you don't need .NET
- uses: actions/checkout@v4
- name: Prepare directories
run: mkdir "${RESULT_DIR}"
- name: Get instance information
run: |
curl -H "Metadata:true" "http://169.254.169.254/metadata/instance?api-version=2019-11-01" | \
jq '{ location : .compute.location, vmSize : .compute.vmSize }' | \
tee ${{ env.RESULT_DIR }}/instance.json
- name: Run argo workflow
env:
RESULT: ${{ env.RESULT_DIR }}/result.json
run: make test-k3s-argo-workflow
- uses: actions/upload-artifact@v4
with:
name: k3s-argo-workflow
path: ${{ env.RESULT_DIR }}
#
# Project checks
# NOTE: Jobs for project checks commonly used in containerd projects
# See https://github.com/containerd/project-checks
#
project:
name: Project Checks
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- uses: actions/setup-go@v5
with:
go-version: '1.22.x'
- uses: actions/checkout@v4
with:
path: src/github.com/containerd/stargz-snapshotter
fetch-depth: 25
- uses: containerd/project-checks@v1.1.0
with:
working-directory: src/github.com/containerd/stargz-snapshotter
- name: Check proto generated code
run: make validate-generated
working-directory: src/github.com/containerd/stargz-snapshotter
- run: ./script/util/verify-no-patent.sh
working-directory: src/github.com/containerd/stargz-snapshotter
- run: make validate-vendor
working-directory: src/github.com/containerd/stargz-snapshotter