1111 - ' **.md'
1212
1313env :
14- UBUNTU_VERSION : " 24.04"
14+ GO_VERSION : canary
15+ GOTOOLCHAIN : local
16+ GO_INSTALL_DESTINATION : /opt
17+ GOOS : linux
1518 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
1619
1720jobs :
1821 linux :
19- runs-on : " ubuntu-24.04"
22+ runs-on : ubuntu-24.04
2023 timeout-minutes : 40
2124 steps :
2225 - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
23- with :
24- fetch-depth : 1
25- - name : " Prepare integration test environment"
26+ - name : " Setup environment"
2627 run : |
28+ # Get latest canary go version
29+ export GO_VERSION=$(make install-go-resolve-version)
30+ # Build integration image with updated dependencies
2731 . ./hack/build-integration-canary.sh
28- canary::build::integration
32+ LOG_LEVEL=info canary::build::integration
2933 - name : " Remove snap loopback devices (conflicts with our loopback devices in TestRunDevice)"
3034 run : |
3135 sudo systemctl disable --now snapd.service snapd.socket
4145 docker run --privileged --rm tonistiigi/binfmt --install linux/amd64
4246 docker run --privileged --rm tonistiigi/binfmt --install linux/arm64
4347 docker run --privileged --rm tonistiigi/binfmt --install linux/arm/v7
48+
4449 - name : " Run unit tests"
4550 run : go test -v ./pkg/...
4651 - name : " Run integration tests"
@@ -50,48 +55,56 @@ jobs:
5055
5156 windows :
5257 timeout-minutes : 40
53- runs-on : windows-latest
58+ runs-on : windows-2022
59+ env :
60+ GOOS : windows
5461 defaults :
5562 run :
5663 shell : bash
5764 steps :
58- - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
65+ - name : " Clone"
66+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
67+ - name : " Setup go environment"
68+ run : |
69+ echo "GO_VERSION=$(make install-go-resolve-version)" >> "$GITHUB_ENV"
70+ echo "PATH=$GO_INSTALL_DESTINATION/go/bin:$HOME/go/bin:$PATH" >> "$GITHUB_ENV"
71+ - name : " Cache go"
72+ uses : actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
73+ id : cache-go
74+ with :
75+ path : /opt/go
76+ key : golang-${{ env.GOOS }}-${{ env.GO_VERSION }}
77+ - if : ${{ steps.cache-go.outputs.cache-hit != 'true' }}
78+ name : " Setup go"
79+ continue-on-error : false
80+ run : make install-go
81+ - name : " Cache dev-tools"
82+ uses : actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
83+ id : cache-go-dev
5984 with :
60- fetch-depth : 1
61- - name : Set GO env
85+ path : ~/go/bin
86+ key : golang-dev-${{ env.GOOS }}-${{ env.GO_VERSION }}-${{ hashFiles('Makefile') }}
87+ - if : ${{ steps.cache-go-dev.outputs.cache-hit != 'true' }}
88+ name : " Setup dev tools"
89+ continue-on-error : false
90+ run : make install-dev-tools
91+ - name : " Setup CNI & containerd"
6292 run : |
63- # Get latest containerd
93+ # CNI install script has not been modified in 3+ years.
94+ # There is little to no reason to update this to latest containerd
95+ curl -fsSLO https://raw.githubusercontent.com/containerd/containerd/refs/tags/v1.7.25/script/setup/install-cni-windows
96+ GOPATH=$(go env GOPATH) ./install-cni-windows
97+ # Setup nerdctl
98+ go install ./cmd/nerdctl
99+ # Get latest tagged containerd
64100 args=(curl --proto '=https' --tlsv1.2 -fsSL -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28")
65101 [ "${GITHUB_TOKEN:-}" == "" ] && {
66- >&2 printf "GITHUB_TOKEN is not set - you might face rate limitations with the Github API\n "
102+ echo "GITHUB_TOKEN is not set - you might face rate limitations with the Github API"
67103 } || args+=(-H "Authorization: Bearer $GITHUB_TOKEN")
68104 ctd_v="$("${args[@]}" https://api.github.com/repos/containerd/containerd/tags | jq -rc .[0].name)"
69- echo "CONTAINERD_VERSION=${ctd_v:1}" >> "$GITHUB_ENV"
70-
71- . ./hack/build-integration-canary.sh
72- canary::golang::latest
73- - uses : actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
74- with :
75- go-version : ${{ env.GO_VERSION }}
76- check-latest : true
77- - run : go install ./cmd/nerdctl
78- - run : make install-dev-tools
79- # This here is solely to get the cni install script, which has not been modified in 3+ years.
80- # There is little to no reason to update this to latest containerd
81- - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
82- with :
83- repository : containerd/containerd
84- ref : " v1.7.25"
85- path : containerd
86- fetch-depth : 1
87- - name : " Set up CNI"
88- working-directory : containerd
89- run : GOPATH=$(go env GOPATH) script/setup/install-cni-windows
90- # Windows setup script can only use released versions
91- - name : " Set up containerd"
92- env :
93- ctrdVersion : ${{ env.CONTAINERD_VERSION }}
94- run : powershell hack/configure-windows-ci.ps1
105+ ctrdVersion="${ctd_v:1}" powershell hack/configure-windows-ci.ps1
106+ - name : " Run unit tests"
107+ run : go test -v ./pkg/...
95108 - name : " Run integration tests"
96109 run : ./hack/test-integration.sh -test.only-flaky=false
97110 - name : " Run integration tests (flaky)"
0 commit comments