132 lines (124 loc) · 4.07 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
name: test
on:
push:
branches:
- master
- 'release/**'
pull_request:
jobs:
project:
name: Project Checks
runs-on: ubuntu-20.04
timeout-minutes: 20
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.18.x
- uses: actions/checkout@v3.0.1
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-20.04
timeout-minutes: 20
steps:
- uses: actions/checkout@v3.0.1
with:
fetch-depth: 1
- uses: actions/setup-go@v3
with:
go-version: 1.18.x
- name: golangci-lint
uses: golangci/golangci-lint-action@v3.1.0
with:
version: v1.45.0
args: --verbose
test-unit:
runs-on: ubuntu-20.04
timeout-minutes: 20
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.18.x
- uses: actions/checkout@v3.0.1
with:
fetch-depth: 1
- name: "Run unit tests"
run: go test -v ./pkg/...
test-integration:
runs-on: ubuntu-20.04
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
containerd: [v1.5.10, v1.6.2, main]
env:
CONTAINERD_VERSION: "${{ matrix.containerd }}"
steps:
- uses: actions/checkout@v3.0.1
with:
fetch-depth: 1
- name: "Prepare integration test environment"
run: DOCKER_BUILDKIT=1 docker build -t test-integration --target test-integration --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-20.04
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
containerd: [v1.5.10, v1.6.2, main]
env:
CONTAINERD_VERSION: "${{ matrix.containerd }}"
steps:
- uses: actions/checkout@v3.0.1
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 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 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-20.04
timeout-minutes: 40
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.18.x
- uses: actions/checkout@v3.0.1
with:
fetch-depth: 1
- name: "Cross"
run: make artifacts
test-integration-docker-compatibility:
runs-on: ubuntu-20.04
timeout-minutes: 20
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.18.x
- uses: actions/checkout@v3.0.1
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