-
Notifications
You must be signed in to change notification settings - Fork 559
152 lines (144 loc) · 4.83 KB
/
test.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
name: test
on:
push:
branches:
- master
- 'release/**'
pull_request:
jobs:
project:
name: Project Checks
runs-on: ubuntu-22.04
timeout-minutes: 20
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.19.x
- uses: actions/checkout@v3.0.2
with:
path: src/github.com/containerd/nerdctl
fetch-depth: 100
- uses: containerd/project-checks@v1.0.2
with:
working-directory: src/github.com/containerd/nerdctl
golangci-lint:
runs-on: ubuntu-22.04
timeout-minutes: 20
steps:
- uses: actions/checkout@v3.0.2
with:
fetch-depth: 1
- uses: actions/setup-go@v3
with:
go-version: 1.19.x
- name: golangci-lint
uses: golangci/golangci-lint-action@v3.2.0
with:
version: v1.49.0
args: --verbose
test-unit:
runs-on: ubuntu-22.04
timeout-minutes: 20
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.19.x
- uses: actions/checkout@v3.0.2
with:
fetch-depth: 1
- name: "Run unit tests"
run: go test -v ./pkg/...
test-integration:
runs-on: "ubuntu-${{ matrix.ubuntu }}"
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
# ubuntu-22.04: cgroup v1, ubuntu-22.04: cgroup v2
include:
- ubuntu: 20.04
containerd: v1.5.13
- ubuntu: 20.04
containerd: v1.6.8
- ubuntu: 22.04
containerd: v1.6.8
- ubuntu: 22.04
containerd: main
env:
UBUNTU_VERSION: "${{ matrix.ubuntu }}"
CONTAINERD_VERSION: "${{ matrix.containerd }}"
steps:
- uses: actions/checkout@v3.0.2
with:
fetch-depth: 1
- name: "Prepare integration test environment"
run: DOCKER_BUILDKIT=1 docker build -t test-integration --target test-integration --build-arg UBUNTU_VERSION=${UBUNTU_VERSION} --build-arg CONTAINERD_VERSION=${CONTAINERD_VERSION} .
- 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: docker run --privileged --rm tonistiigi/binfmt --install all
- name: "Run integration tests"
run: docker run -t --rm --privileged test-integration
test-integration-rootless:
runs-on: "ubuntu-${{ matrix.ubuntu }}"
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
# ubuntu-22.04: cgroup v1, ubuntu-22.04: cgroup v2
include:
- ubuntu: 20.04
containerd: v1.5.13
- ubuntu: 20.04
containerd: v1.6.8
- ubuntu: 22.04
containerd: v1.6.8
- ubuntu: 22.04
containerd: main
env:
UBUNTU_VERSION: "${{ matrix.ubuntu }}"
CONTAINERD_VERSION: "${{ matrix.containerd }}"
steps:
- uses: actions/checkout@v3.0.2
with:
fetch-depth: 1
- name: "Register QEMU (tonistiigi/binfmt)"
run: docker run --privileged --rm tonistiigi/binfmt --install all
- name: "Prepare (network driver=slirp4netns, port driver=builtin)"
run: DOCKER_BUILDKIT=1 docker build -t test-integration-rootless --target test-integration-rootless --build-arg UBUNTU_VERSION=${UBUNTU_VERSION} --build-arg CONTAINERD_VERSION=${CONTAINERD_VERSION} .
- name: "Test (network driver=slirp4netns, port driver=builtin)"
run: docker run -t --rm --privileged test-integration-rootless
- name: "Prepare (network driver=slirp4netns, port driver=slirp4netns)"
run: DOCKER_BUILDKIT=1 docker build -t test-integration-rootless-port-slirp4netns --target test-integration-rootless-port-slirp4netns --build-arg UBUNTU_VERSION=${UBUNTU_VERSION} --build-arg CONTAINERD_VERSION=${CONTAINERD_VERSION} .
- name: "Test (network driver=slirp4netns, port driver=slirp4netns)"
run: docker run -t --rm --privileged test-integration-rootless-port-slirp4netns
cross:
runs-on: ubuntu-22.04
timeout-minutes: 40
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.19.x
- uses: actions/checkout@v3.0.2
with:
fetch-depth: 1
- name: "Cross"
run: make artifacts
test-integration-docker-compatibility:
runs-on: ubuntu-22.04
timeout-minutes: 20
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.19.x
- uses: actions/checkout@v3.0.2
with:
fetch-depth: 1
- name: "Register QEMU (tonistiigi/binfmt)"
run: docker run --privileged --rm tonistiigi/binfmt --install all
- name: "Ensure that the integration test suite is compatible with Docker"
run: go test -v -exec sudo ./cmd/nerdctl/... -args -test.target=docker -test.kill-daemon