Skip to content

Commit

Permalink
Merge pull request #3209 from apostasie/dev-3208
Browse files Browse the repository at this point in the history
Adding a canary CI target to test against upcoming dependencies
  • Loading branch information
AkihiroSuda authored Jul 16, 2024
2 parents 31352aa + db47b31 commit d9e83bd
Show file tree
Hide file tree
Showing 5 changed files with 564 additions and 5 deletions.
103 changes: 103 additions & 0 deletions .github/workflows/test-canary.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# 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:
UBUNTU_VERSION: "24.04"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
linux:
runs-on: "ubuntu-24.04"
timeout-minutes: 40
steps:
- uses: actions/[email protected]
with:
fetch-depth: 1
- name: "Prepare integration test environment"
run: |
./hack/build-integration-canary.sh
- 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 unit tests"
run: go test -v ./pkg/...
- name: "Run integration tests"
continue-on-error: true
run: docker run -t --rm --privileged test-integration

windows:
runs-on: windows-latest
timeout-minutes: 30
defaults:
run:
shell: bash
steps:
- name: Set GO env
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 golang version and split it in components
norm=()
while read -r line; do
norm+=("$line")
done < \
<(sed -E 's/^go([0-9]+)[.]([0-9]+)([.]([0-9]+))?(([a-z]+)([0-9]+))?/\1.\2\n\4\n\6\n\7/i' \
<(curl -fsSL "https://go.dev/dl/?mode=json&include=all" | jq -rc .[0].version) \
)
# Serialize version, making sure we have a patch version, and separate possible rcX into .rc-X
[ "${norm[1]}" != "" ] || norm[1]="0"
norm[1]=".${norm[1]}"
[ "${norm[2]}" == "" ] || norm[2]="-${norm[2]}"
[ "${norm[3]}" == "" ] || norm[3]=".${norm[3]}"
# Save it
IFS=
echo "GO_VERSION=${norm[*]}" >> $GITHUB_ENV
- uses: actions/[email protected]
with:
fetch-depth: 1
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: true
check-latest: true
- run: go install ./cmd/nerdctl
# This here is solely to get the cni install script, which has not been modified in 3+ years.
# There is little to no reason to update this to latest containerd
- uses: actions/[email protected]
with:
repository: containerd/containerd
ref: "v1.7.19"
path: containerd
fetch-depth: 1
- name: "Set up CNI"
working-directory: containerd
run: GOPATH=$(go env GOPATH) script/setup/install-cni-windows
# Windows setup script can only use released versions
- name: "Set up containerd"
env:
ctrdVersion: ${{ env.CONTAINERD_VERSION }}
run: powershell hack/configure-windows-ci.ps1
- name: "Run integration tests"
continue-on-error: true
run: go test -v ./cmd/...
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
- ubuntu: 22.04
containerd: v1.7.19
- ubuntu: 24.04
containerd: main # v2.0.0-rc.X
containerd: v2.0.0-rc.3
env:
UBUNTU_VERSION: "${{ matrix.ubuntu }}"
CONTAINERD_VERSION: "${{ matrix.containerd }}"
Expand Down Expand Up @@ -153,7 +153,7 @@ jobs:
rootlesskit: v2.1.0
target: test-integration-rootless
- ubuntu: 24.04
containerd: main # v2.0.0-rc.X
containerd: v2.0.0-rc.3
rootlesskit: v2.1.0
target: test-integration-rootless
- ubuntu: 24.04
Expand Down
Loading

0 comments on commit d9e83bd

Please sign in to comment.