11
11
- ' **.md'
12
12
13
13
env :
14
- UBUNTU_VERSION : " 24.04"
14
+ GO_VERSION : canary
15
+ GOTOOLCHAIN : local
16
+ GOOS : linux
15
17
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
16
18
17
19
jobs :
18
20
linux :
19
- runs-on : " ubuntu-24.04"
21
+ runs-on : ubuntu-24.04
20
22
timeout-minutes : 40
21
23
steps :
22
24
- uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
23
25
with :
24
26
fetch-depth : 1
25
- - name : " Prepare integration test environment"
27
+ - name : " Setup environment"
26
28
run : |
29
+ # Get latest canary go version
30
+ export GO_VERSION=$(make install-go-resolve-version)
31
+ # Build integration image with updated dependencies
27
32
. ./hack/build-integration-canary.sh
28
- canary::build::integration
33
+ LOG_LEVEL=info canary::build::integration
29
34
- name : " Remove snap loopback devices (conflicts with our loopback devices in TestRunDevice)"
30
35
run : |
31
36
sudo systemctl disable --now snapd.service snapd.socket
@@ -41,24 +46,29 @@ jobs:
41
46
docker run --privileged --rm tonistiigi/binfmt --install linux/amd64
42
47
docker run --privileged --rm tonistiigi/binfmt --install linux/arm64
43
48
docker run --privileged --rm tonistiigi/binfmt --install linux/arm/v7
49
+
44
50
- name : " Run unit tests"
45
- run : go test -v ./pkg/...
51
+ run : docker run -t --rm --privileged test-integration go test -v ./pkg/...
46
52
- name : " Run integration tests"
47
53
run : docker run -t --rm --privileged test-integration ./hack/test-integration.sh -test.only-flaky=false
48
54
- name : " Run integration tests (flaky)"
49
55
run : docker run -t --rm --privileged test-integration ./hack/test-integration.sh -test.only-flaky=true
50
56
51
57
windows :
52
58
timeout-minutes : 40
53
- runs-on : windows-latest
59
+ runs-on : windows-2022
60
+ env :
61
+ GO_INSTALL_DESTINATION : /c/opt
62
+ GOOS : windows
54
63
defaults :
55
64
run :
56
65
shell : bash
57
66
steps :
58
- - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
67
+ - name : " Clone"
68
+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
59
69
with :
60
70
fetch-depth : 1
61
- - name : Set GO env
71
+ - name : " Setup environment "
62
72
run : |
63
73
# Get latest containerd
64
74
args=(curl --proto '=https' --tlsv1.2 -fsSL -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28")
@@ -67,31 +77,58 @@ jobs:
67
77
} || args+=(-H "Authorization: Bearer $GITHUB_TOKEN")
68
78
ctd_v="$("${args[@]}" https://api.github.com/repos/containerd/containerd/tags | jq -rc .[0].name)"
69
79
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
80
+ # Get latest go version
81
+ echo "GO_VERSION=$(make install-go-resolve-version)" >> "$GITHUB_ENV"
82
+ echo "PATH=$GO_INSTALL_DESTINATION/go/bin:$HOME/go/bin:$PATH" >> "$GITHUB_ENV"
83
+ - name : " Cache go"
84
+ uses : actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
85
+ id : cache-go
74
86
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
87
+ path : /c/opt/go
88
+ key : golang-${{ env.GOOS }}-${{ env.GO_VERSION }}
89
+ - name : " Cache dev-tools"
90
+ uses : actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
91
+ id : cache-go-dev
82
92
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
93
+ path : ~/go/bin
94
+ key : golang-dev-${{ env.GOOS }}-${{ env.GO_VERSION }}-${{ hashFiles('Makefile') }}
95
+ - if : ${{ steps.cache-go.outputs.cache-hit != 'true' }}
96
+ name : " Setup go"
97
+ continue-on-error : false
98
+ run : make install-go
99
+ - if : ${{ steps.cache-go-dev.outputs.cache-hit != 'true' }}
100
+ name : " Setup dev tools"
101
+ continue-on-error : false
102
+ run : |
103
+ which go
104
+ go version
105
+ echo $PATH
106
+ uname -s
107
+ ls -lA /c/opt/go/bin
108
+ echo version:
109
+ /c/opt/go/bin/go version
110
+ chmod a+x /c/opt/go/bin/go
111
+ echo version above
112
+ /c/opt/go/bin/go version
113
+ echo version above 2
114
+ make install-dev-tools
115
+ - name : " Setup nerdctl"
116
+ run : go install ./cmd/nerdctl
117
+ - name : " Setup cni"
118
+ run : |
119
+ # CNI install script has not been modified in 3+ years.
120
+ # There is little to no reason to update this to latest containerd
121
+ curl -fsSLO https://raw.githubusercontent.com/containerd/containerd/refs/tags/v1.7.25/script/setup/install-cni-windows
122
+ GOPATH=$(go env GOPATH) ./install-cni-windows
123
+ go install ./cmd/nerdctl
90
124
# Windows setup script can only use released versions
91
- - name : " Set up containerd"
125
+ - name : " Setup containerd"
92
126
env :
93
127
ctrdVersion : ${{ env.CONTAINERD_VERSION }}
94
128
run : powershell hack/configure-windows-ci.ps1
129
+
130
+ - name : " Run unit tests"
131
+ run : go test -v ./pkg/...
95
132
- name : " Run integration tests"
96
133
run : ./hack/test-integration.sh -test.only-flaky=false
97
134
- name : " Run integration tests (flaky)"
0 commit comments