| 1 |
name: Tests |
| 2 |
on: |
| 3 |
push: |
| 4 |
branches: |
| 5 |
- main |
| 6 |
pull_request: |
| 7 |
|
| 8 |
env: |
| 9 |
DOCKER_BUILDKIT: 1 |
| 10 |
|
| 11 |
jobs: |
| 12 |
build: |
| 13 |
runs-on: ubuntu-22.04 |
| 14 |
name: Build |
| 15 |
steps: |
| 16 |
- uses: actions/checkout@v3 |
| 17 |
- name: Build all |
| 18 |
run: ./script/util/make.sh build -j2 |
| 19 |
|
| 20 |
test: |
| 21 |
runs-on: ubuntu-22.04 |
| 22 |
name: Test |
| 23 |
steps: |
| 24 |
- uses: actions/checkout@v3 |
| 25 |
- name: Test all |
| 26 |
run: ./script/util/make.sh test-all -j2 |
| 27 |
|
| 28 |
linter: |
| 29 |
runs-on: ubuntu-22.04 |
| 30 |
name: Linter |
| 31 |
steps: |
| 32 |
- uses: actions/checkout@v3 |
| 33 |
with: |
| 34 |
fetch-depth: '0' |
| 35 |
- uses: actions/setup-go@v3 |
| 36 |
with: |
| 37 |
go-version: '1.19.x' |
| 38 |
- name: golangci-lint |
| 39 |
uses: golangci/[email protected] |
| 40 |
with: |
| 41 |
version: v1.49.0 |
| 42 |
args: --verbose |
| 43 |
|
| 44 |
integration: |
| 45 |
runs-on: ubuntu-22.04 |
| 46 |
name: Integration |
| 47 |
strategy: |
| 48 |
fail-fast: false |
| 49 |
matrix: |
| 50 |
buildargs: ["", "--build-arg=CONTAINERD_VERSION=main"] # released version & main version |
| 51 |
builtin: ["true", "false"] |
| 52 |
metadata-store: ["memory", "db"] |
| 53 |
exclude: |
| 54 |
- buildargs: "" |
| 55 |
builtin: "true" |
| 56 |
- metadata-store: "db" |
| 57 |
builtin: "true" |
| 58 |
- metadata-store: "db" |
| 59 |
buildargs: "--build-arg=CONTAINERD_VERSION=main" |
| 60 |
steps: |
| 61 |
- name: Install htpasswd for setting up private registry |
| 62 |
run: sudo apt-get update -y && sudo apt-get --no-install-recommends install -y apache2-utils |
| 63 |
- uses: actions/checkout@v3 |
| 64 |
- name: Run integration test |
| 65 |
env: |
| 66 |
DOCKER_BUILD_ARGS: ${{ matrix.buildargs }} |
| 67 |
BUILTIN_SNAPSHOTTER: ${{ matrix.builtin }} |
| 68 |
METADATA_STORE: ${{ matrix.metadata-store }} |
| 69 |
run: make integration |
| 70 |
|
| 71 |
test-optimize: |
| 72 |
runs-on: ubuntu-22.04 |
| 73 |
name: Optimize |
| 74 |
strategy: |
| 75 |
fail-fast: false |
| 76 |
matrix: |
| 77 |
buildargs: ["", "--build-arg=CONTAINERD_VERSION=main"] # released version & main version |
| 78 |
steps: |
| 79 |
- name: Install htpasswd for setting up private registry |
| 80 |
run: sudo apt-get update -y && sudo apt-get --no-install-recommends install -y apache2-utils |
| 81 |
- uses: actions/checkout@v3 |
| 82 |
- name: Run test for optimize subcommand of ctr-remote |
| 83 |
env: |
| 84 |
DOCKER_BUILD_ARGS: ${{ matrix.buildargs }} |
| 85 |
run: make test-optimize |
| 86 |
|
| 87 |
test-kind: |
| 88 |
runs-on: ubuntu-22.04 |
| 89 |
name: Kind |
| 90 |
strategy: |
| 91 |
fail-fast: false |
| 92 |
matrix: |
| 93 |
buildargs: ["", "--build-arg=CONTAINERD_VERSION=main"] # released version & main version |
| 94 |
builtin: ["true", "false"] |
| 95 |
exclude: |
| 96 |
- buildargs: "" |
| 97 |
builtin: "true" |
| 98 |
steps: |
| 99 |
- name: Install htpasswd for setting up private registry |
| 100 |
run: sudo apt-get update -y && sudo apt-get --no-install-recommends install -y apache2-utils |
| 101 |
- uses: actions/checkout@v3 |
| 102 |
- name: Run test for pulling image from private registry on Kubernetes |
| 103 |
env: |
| 104 |
DOCKER_BUILD_ARGS: ${{ matrix.buildargs }} |
| 105 |
BUILTIN_SNAPSHOTTER: ${{ matrix.builtin }} |
| 106 |
run: make test-kind |
| 107 |
|
| 108 |
test-criauth: |
| 109 |
runs-on: ubuntu-22.04 |
| 110 |
name: CRIAuth |
| 111 |
strategy: |
| 112 |
fail-fast: false |
| 113 |
matrix: |
| 114 |
buildargs: ["", "--build-arg=CONTAINERD_VERSION=main"] # released version & main version |
| 115 |
builtin: ["true", "false"] |
| 116 |
exclude: |
| 117 |
- buildargs: "" |
| 118 |
builtin: "true" |
| 119 |
steps: |
| 120 |
- name: Install htpasswd for setting up private registry |
| 121 |
run: sudo apt-get update -y && sudo apt-get --no-install-recommends install -y apache2-utils |
| 122 |
- uses: actions/checkout@v3 |
| 123 |
- name: Run test for pulling image from private registry on Kubernetes with CRI keychain mode |
| 124 |
env: |
| 125 |
DOCKER_BUILD_ARGS: ${{ matrix.buildargs }} |
| 126 |
BUILTIN_SNAPSHOTTER: ${{ matrix.builtin }} |
| 127 |
run: make test-criauth |
| 128 |
|
| 129 |
test-cri-containerd: |
| 130 |
runs-on: ubuntu-22.04 |
| 131 |
name: CRIValidationContainerd |
| 132 |
strategy: |
| 133 |
fail-fast: false |
| 134 |
matrix: |
| 135 |
buildargs: ["", "--build-arg=CONTAINERD_VERSION=main"] # released version & main version |
| 136 |
builtin: ["true", "false"] |
| 137 |
metadata-store: ["memory", "db"] |
| 138 |
exclude: |
| 139 |
- buildargs: "" |
| 140 |
builtin: "true" |
| 141 |
- metadata-store: "db" |
| 142 |
builtin: "true" |
| 143 |
- metadata-store: "db" |
| 144 |
buildargs: "--build-arg=CONTAINERD_VERSION=main" |
| 145 |
steps: |
| 146 |
- uses: actions/checkout@v3 |
| 147 |
- name: Validate containerd through CRI |
| 148 |
env: |
| 149 |
DOCKER_BUILD_ARGS: ${{ matrix.buildargs }} |
| 150 |
BUILTIN_SNAPSHOTTER: ${{ matrix.builtin }} |
| 151 |
METADATA_STORE: ${{ matrix.metadata-store }} |
| 152 |
run: make test-cri-containerd |
| 153 |
|
| 154 |
test-cri-cri-o: |
| 155 |
runs-on: ubuntu-18.04 |
| 156 |
name: CRIValidationCRIO |
| 157 |
strategy: |
| 158 |
fail-fast: false |
| 159 |
matrix: |
| 160 |
metadata-store: ["memory", "db"] |
| 161 |
steps: |
| 162 |
- uses: actions/checkout@v3 |
| 163 |
- name: Validate CRI-O through CRI |
| 164 |
env: |
| 165 |
DOCKER_BUILD_ARGS: "--build-arg=RUNC_VERSION=v1.0.3" |
| 166 |
METADATA_STORE: ${{ matrix.metadata-store }} |
| 167 |
run: make test-cri-o |
| 168 |
|
| 169 |
test-podman: |
| 170 |
runs-on: ubuntu-22.04 |
| 171 |
name: PodmanRootless |
| 172 |
steps: |
| 173 |
- uses: actions/checkout@v3 |
| 174 |
- name: Test Podman (rootless) |
| 175 |
run: make test-podman |
| 176 |
|
| 177 |
test-k3s: |
| 178 |
runs-on: ubuntu-22.04 |
| 179 |
name: K3S |
| 180 |
steps: |
| 181 |
- uses: actions/setup-go@v3 |
| 182 |
with: |
| 183 |
go-version: '1.19.x' |
| 184 |
- name: Install k3d |
| 185 |
run: | |
| 186 |
wget -q -O - https://raw.githubusercontent.com/rancher/k3d/v5.0.0/install.sh | bash |
| 187 |
- name: Install htpasswd for setting up private registry |
| 188 |
run: sudo apt-get update -y && sudo apt-get --no-install-recommends install -y apache2-utils |
| 189 |
- name: Install yq |
| 190 |
run: | |
| 191 |
sudo wget -O /usr/local/bin/yq https://github.com/mikefarah/yq/releases/download/v4.9.3/yq_linux_amd64 |
| 192 |
sudo chmod +x /usr/local/bin/yq |
| 193 |
- uses: actions/checkout@v3 |
| 194 |
- name: Run test with k3s |
| 195 |
run: make test-k3s |
| 196 |
|
| 197 |
test-ipfs: |
| 198 |
runs-on: ubuntu-22.04 |
| 199 |
name: IPFS |
| 200 |
steps: |
| 201 |
- uses: actions/checkout@v3 |
| 202 |
- name: Run test |
| 203 |
run: make test-ipfs |
| 204 |
|
| 205 |
test-k3s-argo-workflow: |
| 206 |
runs-on: ubuntu-22.04 |
| 207 |
name: K3SArgoWorkflow |
| 208 |
env: |
| 209 |
RESULT_DIR: ${{ github.workspace }}/argo-workflow/ |
| 210 |
steps: |
| 211 |
- uses: actions/setup-go@v3 |
| 212 |
with: |
| 213 |
go-version: '1.19.x' |
| 214 |
- name: Install k3d |
| 215 |
run: | |
| 216 |
wget -q -O - https://raw.githubusercontent.com/rancher/k3d/v5.0.0/install.sh | bash |
| 217 |
- name: Install argo worklflow |
| 218 |
run: | |
| 219 |
wget -q https://github.com/argoproj/argo-workflows/releases/download/v3.0.10/argo-linux-amd64.gz |
| 220 |
gunzip argo-linux-amd64.gz |
| 221 |
sudo mv argo-linux-amd64 /usr/local/bin/argo |
| 222 |
sudo chmod +x /usr/local/bin/argo |
| 223 |
- uses: actions/checkout@v3 |
| 224 |
- name: Prepare directories |
| 225 |
run: mkdir "${RESULT_DIR}" |
| 226 |
- name: Get instance information |
| 227 |
run: | |
| 228 |
curl -H "Metadata:true" "http://169.254.169.254/metadata/instance?api-version=2019-11-01" | \ |
| 229 |
jq '{ location : .compute.location, vmSize : .compute.vmSize }' | \ |
| 230 |
tee ${{ env.RESULT_DIR }}/instance.json |
| 231 |
- name: Run argo workflow |
| 232 |
env: |
| 233 |
RESULT: ${{ env.RESULT_DIR }}/result.json |
| 234 |
run: make test-k3s-argo-workflow |
| 235 |
- uses: actions/upload-artifact@v3 |
| 236 |
with: |
| 237 |
name: k3s-argo-workflow |
| 238 |
path: ${{ env.RESULT_DIR }} |
| 239 |
|
| 240 |
# |
| 241 |
# Project checks |
| 242 |
# NOTE: Jobs for project checks commonly used in containerd projects |
| 243 |
# See https://github.com/containerd/project-checks |
| 244 |
# |
| 245 |
|
| 246 |
project: |
| 247 |
name: Project Checks |
| 248 |
runs-on: ubuntu-22.04 |
| 249 |
timeout-minutes: 5 |
| 250 |
steps: |
| 251 |
- uses: actions/setup-go@v3 |
| 252 |
with: |
| 253 |
go-version: '1.19.x' |
| 254 |
- uses: actions/checkout@v3 |
| 255 |
with: |
| 256 |
path: src/github.com/containerd/stargz-snapshotter |
| 257 |
fetch-depth: 25 |
| 258 |
- uses: containerd/project-checks@v1 |
| 259 |
with: |
| 260 |
working-directory: src/github.com/containerd/stargz-snapshotter |
| 261 |
- name: Check proto generated code |
| 262 |
run: make validate-generated |
| 263 |
working-directory: src/github.com/containerd/stargz-snapshotter |
| 264 |
- run: ./script/util/verify-no-patent.sh |
| 265 |
working-directory: src/github.com/containerd/stargz-snapshotter |