github.com/containerd/containerd@v22.0.0-20200918172823-438c87b8e050+incompatible/.github/workflows/ci.yml (about) 1 name: CI 2 on: 3 push: 4 branches: 5 - master 6 - 'release/**' 7 pull_request: 8 branches: 9 - master 10 - 'release/**' 11 12 jobs: 13 # 14 # golangci-lint 15 # 16 linters: 17 name: Linters 18 runs-on: ${{ matrix.os }} 19 timeout-minutes: 10 20 21 strategy: 22 matrix: 23 os: [ubuntu-18.04, macos-10.15] # TODO: pass linters on 'windows-2019' 24 25 steps: 26 - name: Install Go 27 uses: actions/setup-go@v1 28 with: 29 go-version: '1.15.2' 30 31 - name: Set env 32 shell: bash 33 run: | 34 echo "::set-env name=GOPATH::${{ github.workspace }}" 35 echo "::add-path::${{ github.workspace }}/bin" 36 37 - name: Checkout 38 uses: actions/checkout@v2 39 with: 40 path: src/github.com/containerd/containerd 41 42 - name: Install dev tools 43 env: 44 GO111MODULE: off 45 shell: bash 46 run: script/setup/install-dev-tools 47 working-directory: src/github.com/containerd/containerd 48 49 - name: Make check 50 shell: bash 51 run: make check 52 working-directory: src/github.com/containerd/containerd 53 54 # 55 # Project checks 56 # 57 project: 58 name: Project Checks 59 runs-on: ubuntu-18.04 60 timeout-minutes: 5 61 62 steps: 63 # 64 # Install Go 65 # 66 - name: Install Go 67 uses: actions/setup-go@v1 68 with: 69 go-version: '1.15.2' 70 71 - name: Set env 72 shell: bash 73 run: | 74 echo "::set-env name=GOPATH::${{ github.workspace }}" 75 echo "::add-path::${{ github.workspace }}/bin" 76 77 # 78 # Checkout repos 79 # 80 - name: Checkout this repo 81 uses: actions/checkout@v2 82 with: 83 path: src/github.com/containerd/containerd 84 fetch-depth: 100 85 86 - name: Checkout project repo 87 uses: actions/checkout@v2 88 with: 89 repository: containerd/project 90 path: src/github.com/containerd/project 91 92 # 93 # Go get dependencies 94 # 95 - name: Install dependencies 96 env: 97 GO111MODULE: off 98 run: | 99 go get -u github.com/vbatts/git-validation 100 go get -u github.com/kunalkushwaha/ltag 101 go get -u github.com/LK4D4/vndr 102 103 # 104 # DCO / File headers / Vendor directory validation 105 # 106 - name: DCO 107 env: 108 GITHUB_COMMIT_URL: ${{ github.event.pull_request.commits_url }} 109 DCO_VERBOSITY: "-q" 110 DCO_RANGE: "" 111 working-directory: src/github.com/containerd/containerd 112 run: | 113 set -x 114 if [ -z "${GITHUB_COMMIT_URL}" ]; then 115 DCO_RANGE=$(jq -r '.after + "..HEAD"' ${GITHUB_EVENT_PATH}) 116 else 117 DCO_RANGE=$(curl ${GITHUB_COMMIT_URL} | jq -r '.[0].parents[0].sha + "..HEAD"') 118 fi 119 ../project/script/validate/dco 120 121 - name: Headers 122 run: ../project/script/validate/fileheader ../project/ 123 working-directory: src/github.com/containerd/containerd 124 125 - name: Vendor 126 run: ../project/script/validate/vendor 127 working-directory: src/github.com/containerd/containerd 128 129 # 130 # Protobuf checks 131 # 132 protos: 133 name: Protobuf 134 runs-on: ubuntu-18.04 135 timeout-minutes: 5 136 137 steps: 138 - name: Set up Go 139 uses: actions/setup-go@v1 140 with: 141 go-version: '1.15.2' 142 143 - name: Set env 144 shell: bash 145 run: | 146 echo "::set-env name=GOPATH::${{ github.workspace }}" 147 echo "::add-path::${{ github.workspace }}/bin" 148 149 - name: Checkout 150 uses: actions/checkout@v2 151 with: 152 path: src/github.com/containerd/containerd 153 154 - name: Install protobuf 155 env: 156 GO111MODULE: off 157 working-directory: src/github.com/containerd/containerd 158 run: | 159 sudo env PATH=$PATH GOPATH=$GOPATH script/setup/install-protobuf 160 sudo chmod +x /usr/local/bin/protoc 161 sudo chmod og+rx /usr/local/include/google /usr/local/include/google/protobuf /usr/local/include/google/protobuf/compiler 162 sudo chmod -R og+r /usr/local/include/google/protobuf/ 163 protoc --version 164 165 - name: Install dev tools 166 env: 167 GO111MODULE: off 168 run: script/setup/install-dev-tools 169 working-directory: src/github.com/containerd/containerd 170 171 - name: Make 172 env: 173 GO111MODULE: off 174 working-directory: src/github.com/containerd/containerd 175 run: | 176 export PATH=$PATH:$(go env GOPATH)/bin 177 make check-protos check-api-descriptors 178 179 man: 180 name: Manpages 181 runs-on: ubuntu-18.04 182 timeout-minutes: 5 183 184 steps: 185 - name: Install Go 186 uses: actions/setup-go@v1 187 with: 188 go-version: '1.15.2' 189 190 - name: Set env 191 shell: bash 192 run: | 193 echo "::set-env name=GOPATH::${{ github.workspace }}" 194 echo "::add-path::${{ github.workspace }}/bin" 195 196 - name: Checkout 197 uses: actions/checkout@v2 198 with: 199 path: src/github.com/containerd/containerd 200 201 - name: Install dependencies 202 run: GO111MODULE=on go get github.com/cpuguy83/go-md2man/v2@v2.0.0 203 204 - name: Make 205 run: make man 206 working-directory: src/github.com/containerd/containerd 207 208 # 209 # Build containerd binaries 210 # 211 binaries: 212 name: Binaries 213 runs-on: ${{ matrix.os }} 214 timeout-minutes: 10 215 needs: [project, linters, protos, man] 216 217 strategy: 218 matrix: 219 os: [ubuntu-18.04, macos-10.15, windows-2019] 220 221 steps: 222 - name: Install Go 223 uses: actions/setup-go@v1 224 with: 225 go-version: '1.15.2' 226 227 - name: Set env 228 shell: bash 229 run: | 230 echo "::set-env name=GOPATH::${{ github.workspace }}" 231 echo "::add-path::${{ github.workspace }}/bin" 232 233 - name: Checkout 234 uses: actions/checkout@v2 235 with: 236 path: src/github.com/containerd/containerd 237 238 - name: Make 239 run: | 240 make build 241 make binaries 242 working-directory: src/github.com/containerd/containerd 243 244 # 245 # Integration and CRI tests 246 # 247 integration-windows: 248 name: Windows Integration 249 runs-on: windows-2019 250 timeout-minutes: 30 251 needs: [project, linters, protos, man] 252 253 steps: 254 - name: Install Go 255 uses: actions/setup-go@v1 256 with: 257 go-version: '1.15.2' 258 259 - name: Set env 260 shell: bash 261 run: | 262 echo "::set-env name=GOPATH::${{ github.workspace }}" 263 echo "::add-path::${{ github.workspace }}/src/github.com/containerd/containerd/bin" 264 265 - name: Checkout containerd 266 uses: actions/checkout@v2 267 with: 268 path: src/github.com/containerd/containerd 269 - name: Checkout Microsoft/hcsshim 270 uses: actions/checkout@v2 271 with: 272 repository: Microsoft/hcsshim 273 path: src/github.com/Microsoft/hcsshim 274 275 - name: Install Build Deps 276 shell: bash 277 run: | 278 cd src/github.com/containerd/containerd 279 script/setup/install-dev-tools 280 - name: Binaries 281 shell: bash 282 run: | 283 set -o xtrace 284 export CGO_ENABLED=1 285 cd src/github.com/containerd/containerd 286 mingw32-make.exe binaries 287 bindir="$(pwd)" 288 SHIM_COMMIT=$(grep Microsoft/hcsshim vendor.conf | awk '{print $2}') 289 cd ../../Microsoft/hcsshim 290 git fetch --tags origin "${SHIM_COMMIT}" 291 git checkout "${SHIM_COMMIT}" 292 GO111MODULE=on go build -mod=vendor -o "${bindir}/containerd-shim-runhcs-v1.exe" ./cmd/containerd-shim-runhcs-v1 293 - name: Integration 1 294 shell: bash 295 run: | 296 cd src/github.com/containerd/containerd 297 export CGO_ENABLED=1 298 mingw32-make.exe integration 299 # Run the integration suite a second time. See discussion in github.com/containerd/containerd/pull/175 300 - name: Integration 2 301 shell: bash 302 run: | 303 cd src/github.com/containerd/containerd 304 export TESTFLAGS_PARALLEL=1 305 export CGO_ENABLED=1 306 mingw32-make.exe integration 307 308 integration-linux: 309 name: Linux Integration 310 runs-on: ubuntu-18.04 311 timeout-minutes: 15 312 needs: [project, linters, protos, man] 313 314 strategy: 315 matrix: 316 runtime: [io.containerd.runtime.v1.linux, io.containerd.runc.v1, io.containerd.runc.v2] 317 runc: [runc, crun] 318 exclude: 319 - runtime: io.containerd.runc.v1 320 runc: crun 321 - runtime: io.containerd.runtime.v1.linux 322 runc: crun 323 324 steps: 325 - name: Install Go 326 uses: actions/setup-go@v1 327 with: 328 go-version: '1.15.2' 329 330 - name: Setup gosu 331 shell: bash 332 run: | 333 GOSU=/usr/local/bin/gosu 334 arch="$(dpkg --print-architecture | awk -F- '{ print $NF }')" 335 sudo wget -O ${GOSU} "https://github.com/tianon/gosu/releases/download/1.12/gosu-$arch" 336 sudo chmod +x ${GOSU} 337 sudo chown root ${GOSU} 338 sudo chmod +s ${GOSU} 339 340 - name: Set env 341 shell: bash 342 run: | 343 echo "::set-env name=GOPATH::${{ github.workspace }}" 344 echo "::add-path::${{ github.workspace }}/bin" 345 346 - name: Checkout containerd 347 uses: actions/checkout@v2 348 with: 349 path: src/github.com/containerd/containerd 350 351 - name: Install containerd dependencies 352 env: 353 RUNC_FLAVOR: ${{ matrix.runc }} 354 run: | 355 sudo PATH=$PATH script/setup/install-seccomp 356 gosu root script/setup/install-runc 357 script/setup/install-cni 358 script/setup/install-critools 359 working-directory: src/github.com/containerd/containerd 360 361 - name: Install criu 362 run: | 363 sudo apt-get install -y \ 364 libprotobuf-dev \ 365 libprotobuf-c-dev \ 366 protobuf-c-compiler \ 367 protobuf-compiler \ 368 python-protobuf \ 369 libnl-3-dev \ 370 libnet-dev \ 371 libcap-dev \ 372 python-future 373 wget https://github.com/checkpoint-restore/criu/archive/v3.13.tar.gz -O criu.tar.gz 374 tar -zxf criu.tar.gz 375 cd criu-3.13 376 sudo make install-criu 377 378 - name: Install containerd 379 env: 380 CGO_ENABLED: 1 381 run: | 382 make binaries 383 sudo make install 384 working-directory: src/github.com/containerd/containerd 385 386 - name: Integration 1 387 env: 388 GOPROXY: direct 389 TEST_RUNTIME: ${{ matrix.runtime }} 390 RUNC_FLAVOR: ${{ matrix.runc }} 391 run: | 392 sudo GOPATH=$GOPATH GOPROXY=$GOPROXY TEST_RUNTIME=$TEST_RUNTIME RUNC_FLAVOR=$RUNC_FLAVOR make integration EXTRA_TESTFLAGS=-no-criu TESTFLAGS_RACE=-race 393 working-directory: src/github.com/containerd/containerd 394 395 # Run the integration suite a second time. See discussion in github.com/containerd/containerd/pull/1759 396 - name: Integration 2 397 env: 398 GOPROXY: direct 399 TEST_RUNTIME: ${{ matrix.runtime }} 400 RUNC_FLAVOR: ${{ matrix.runc }} 401 run: | 402 sudo GOPATH=$GOPATH GOPROXY=$GOPROXY TEST_RUNTIME=$TEST_RUNTIME RUNC_FLAVOR=$RUNC_FLAVOR TESTFLAGS_PARALLEL=1 make integration EXTRA_TESTFLAGS=-no-criu 403 working-directory: src/github.com/containerd/containerd 404 405 - name: CRI test 406 env: 407 TEST_RUNTIME: ${{ matrix.runtime }} 408 run: | 409 BDIR="$(mktemp -d -p $PWD)" 410 mkdir -p ${BDIR}/{root,state} 411 cat > ${BDIR}/config.toml <<EOF 412 [plugins.cri.containerd.default_runtime] 413 runtime_type = \"${TEST_RUNTIME}\" 414 EOF 415 ls /etc/cni/net.d 416 sudo PATH=$PATH BDIR=$BDIR /usr/local/bin/containerd -a ${BDIR}/c.sock -root ${BDIR}/root -state ${BDIR}/state -log-level debug &> ${BDIR}/containerd-cri.log & 417 sudo PATH=$PATH BDIR=$BDIR /usr/local/bin/ctr -a ${BDIR}/c.sock version 418 sudo PATH=$PATH BDIR=$BDIR GOPATH=$GOPATH critest --runtime-endpoint=unix:///${BDIR}/c.sock --parallel=8 419 TEST_RC=$? 420 test $TEST_RC -ne 0 && cat ${BDIR}/containerd-cri.log 421 sudo pkill containerd 422 sudo BDIR=$BDIR rm -rf ${BDIR} 423 test $TEST_RC -eq 0 || /bin/false 424 425 cgroup2: 426 name: CGroupsV2 and SELinux Integration 427 # nested virtualization is only available on macOS hosts 428 runs-on: macos-10.15 429 timeout-minutes: 40 430 needs: [project, linters, protos, man] 431 strategy: 432 matrix: 433 # Currently crun is disabled to decrease CI flakiness. 434 # We can enable crun again when we get a better CI infra. 435 runc: [runc] 436 steps: 437 - name: Checkout containerd 438 uses: actions/checkout@v2 439 440 - name: Start vagrant 441 run: vagrant up 442 443 - name: Integration 444 env: 445 RUNC_FLAVOR: ${{ matrix.runc }} 446 # SELinux: replace Permissive with Enforcing after https://github.com/containers/container-selinux/pull/98 447 # is merged and the package becomes generally available. 448 SELINUX: Permissive 449 run: vagrant up --provision-with=selinux,install-runc,test-integration 450 451 - name: CRI test 452 env: 453 RUNC_FLAVOR: ${{ matrix.runc }} 454 # SELinux: replace Permissive with Enforcing after https://github.com/containers/container-selinux/pull/98 455 # is merged and the package becomes generally available. 456 SELINUX: Permissive 457 run: vagrant up --provision-with=selinux,install-runc,test-cri