-
Notifications
You must be signed in to change notification settings - Fork 614
116 lines (110 loc) · 4.14 KB
/
test-canary.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
# This pipeline purpose is solely meant to run a subset of our test suites against upcoming or unreleased dependencies versions
name: canary
on:
push:
branches:
- main
- 'release/**'
pull_request:
paths-ignore:
- '**.md'
env:
UBUNTU_VERSION: "24.04"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
lint:
runs-on: "ubuntu-24.04"
timeout-minutes: 20
steps:
- uses: actions/[email protected]
with:
fetch-depth: 1
- name: Set GO env
run: |
. ./hack/build-integration-canary.sh
canary::golang::latest
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
cache: true
- name: golangci-lint
uses: golangci/[email protected]
with:
args: --verbose
linux:
runs-on: "ubuntu-24.04"
timeout-minutes: 40
steps:
- uses: actions/[email protected]
with:
fetch-depth: 1
- name: "Prepare integration test environment"
run: |
. ./hack/build-integration-canary.sh
canary::build::integration
- name: "Remove snap loopback devices (conflicts with our loopback devices in TestRunDevice)"
run: |
sudo systemctl disable --now snapd.service snapd.socket
sudo apt-get purge -y snapd
sudo losetup -Dv
sudo losetup -lv
- name: "Register QEMU (tonistiigi/binfmt)"
run: |
# `--install all` will only install emulation for architectures that cannot be natively executed
# Since some arm64 platforms do provide native fallback execution for 32 bits,
# armv7 emulation may or may not be installed, causing variance in the result of `uname -m`.
# To avoid that, we explicitly list the architectures we do want emulation for.
docker run --privileged --rm tonistiigi/binfmt --install linux/amd64
docker run --privileged --rm tonistiigi/binfmt --install linux/arm64
docker run --privileged --rm tonistiigi/binfmt --install linux/arm/v7
- name: "Run unit tests"
run: go test -v ./pkg/...
- name: "Run integration tests"
run: docker run -t --rm --privileged test-integration
windows:
runs-on: windows-latest
timeout-minutes: 30
defaults:
run:
shell: bash
steps:
- uses: actions/[email protected]
with:
fetch-depth: 1
- name: Set GO env
run: |
# Get latest containerd
args=(curl --proto '=https' --tlsv1.2 -fsSL -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28")
[ "${GITHUB_TOKEN:-}" == "" ] && {
>&2 printf "GITHUB_TOKEN is not set - you might face rate limitations with the Github API\n"
} || args+=(-H "Authorization: Bearer $GITHUB_TOKEN")
ctd_v="$("${args[@]}" https://api.github.com/repos/containerd/containerd/tags | jq -rc .[0].name)"
echo "CONTAINERD_VERSION=${ctd_v:1}" >> "$GITHUB_ENV"
. ./hack/build-integration-canary.sh
canary::golang::latest
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: true
check-latest: true
- run: go install ./cmd/nerdctl
# This here is solely to get the cni install script, which has not been modified in 3+ years.
# There is little to no reason to update this to latest containerd
- uses: actions/[email protected]
with:
repository: containerd/containerd
ref: "v1.7.22"
path: containerd
fetch-depth: 1
- name: "Set up CNI"
working-directory: containerd
run: GOPATH=$(go env GOPATH) script/setup/install-cni-windows
# Windows setup script can only use released versions
- name: "Set up containerd"
env:
ctrdVersion: ${{ env.CONTAINERD_VERSION }}
run: powershell hack/configure-windows-ci.ps1
- name: "Run integration tests"
# See https://github.com/containerd/nerdctl/blob/main/docs/testing/README.md#about-parallelization
run: go test -p 1 -v ./cmd/nerdctl/...