[WIP] CI, build NEXT #2606
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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: | |
GO_VERSION: canary | |
GOTOOLCHAIN: local | |
GOOS: linux | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
jobs: | |
linux: | |
runs-on: ubuntu-24.04 | |
timeout-minutes: 40 | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
fetch-depth: 1 | |
- name: "Setup environment" | |
run: | | |
# Get latest canary go version | |
export GO_VERSION=$(make install-go-resolve-version) | |
# Build integration image with updated dependencies | |
. ./hack/build-integration-canary.sh | |
LOG_LEVEL=info 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 -qq 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: docker run -t --rm --privileged test-integration go test -v ./pkg/... | |
- name: "Run integration tests" | |
run: docker run -t --rm --privileged test-integration ./hack/test-integration.sh -test.only-flaky=false | |
- name: "Run integration tests (flaky)" | |
run: docker run -t --rm --privileged test-integration ./hack/test-integration.sh -test.only-flaky=true | |
windows: | |
timeout-minutes: 40 | |
runs-on: windows-2022 | |
env: | |
GO_INSTALL_DESTINATION: /c/opt | |
GOOS: windows | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: "Clone" | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
fetch-depth: 1 | |
- name: "Setup environment" | |
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" | |
# Get latest go version | |
echo "GO_VERSION=$(make install-go-resolve-version)" >> "$GITHUB_ENV" | |
echo "PATH=$GO_INSTALL_DESTINATION/go/bin:$HOME/go/bin:$PATH" >> "$GITHUB_ENV" | |
- name: "Cache go" | |
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2 | |
id: cache-go | |
with: | |
path: /c/opt/go | |
key: golang-${{ env.GOOS }}-${{ env.GO_VERSION }} | |
- name: "Cache dev-tools" | |
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2 | |
id: cache-go-dev | |
with: | |
path: ~/go/bin | |
key: golang-dev-${{ env.GOOS }}-${{ env.GO_VERSION }}-${{ hashFiles('Makefile') }} | |
- if: ${{ steps.cache-go.outputs.cache-hit != 'true' }} | |
name: "Setup go" | |
continue-on-error: false | |
run: make install-go | |
- if: ${{ steps.cache-go-dev.outputs.cache-hit != 'true' }} | |
name: "Setup dev tools" | |
continue-on-error: false | |
run: | | |
which go | |
go version | |
echo $PATH | |
uname -s | |
ls -lA /c/opt/go/bin | |
echo version: | |
/c/opt/go/bin/go version | |
chmod a+x /c/opt/go/bin/go | |
echo version above | |
/c/opt/go/bin/go version | |
echo version above 2 | |
make install-dev-tools | |
- name: "Setup nerdctl" | |
run: go install ./cmd/nerdctl | |
- name: "Setup cni" | |
run: | | |
# CNI install script has not been modified in 3+ years. | |
# There is little to no reason to update this to latest containerd | |
curl -fsSLO https://raw.githubusercontent.com/containerd/containerd/refs/tags/v1.7.25/script/setup/install-cni-windows | |
GOPATH=$(go env GOPATH) ./install-cni-windows | |
go install ./cmd/nerdctl | |
# Windows setup script can only use released versions | |
- name: "Setup containerd" | |
env: | |
ctrdVersion: ${{ env.CONTAINERD_VERSION }} | |
run: powershell hack/configure-windows-ci.ps1 | |
- name: "Run unit tests" | |
run: go test -v ./pkg/... | |
- name: "Run integration tests" | |
run: ./hack/test-integration.sh -test.only-flaky=false | |
- name: "Run integration tests (flaky)" | |
run: ./hack/test-integration.sh -test.only-flaky=true |