14
14
REGISTRY : ghcr.io
15
15
BUSYBOX_VERSION : 5ad83957fa74aafd061afbfb8da14ce3220659a9
16
16
REGISTRY_VERSION : v2.8.3
17
+ CURL_VERSION : 8.11.0_4
17
18
18
19
jobs :
19
20
build-busybox :
25
26
with :
26
27
path : busybox.exe
27
28
enableCrossOsArchive : true
28
- key : cache-busybox-${{ env.BUSYBOX_VERSION }}-a
29
+ key : cache-busybox-${{ env.BUSYBOX_VERSION }}
29
30
- uses : actions/checkout@v4
30
31
if : steps.cache-busybox.outputs.cache-hit != 'true'
31
32
with :
43
44
cd -
44
45
cp ./src/busybox-w32/busybox.exe .
45
46
47
+ build-curl :
48
+ name : busybox
49
+ runs-on : ubuntu-24.04
50
+ steps :
51
+ - id : cache-curl
52
+ uses : actions/cache@v4
53
+ with :
54
+ path : curl.exe
55
+ enableCrossOsArchive : true
56
+ key : cache-curl-${{ env.CURL_VERSION }}
57
+ - name : " "
58
+ if : steps.cache-curl.outputs.cache-hit != 'true'
59
+ run : |
60
+ curl -fsSLO https://curl.se/windows/dl-${CURL_VERSION}/curl-${CURL_VERSION}-win64-mingw.zip
61
+ unzip curl-${CURL_VERSION}-win64-mingw.zip
62
+ cp ./curl-${CURL_VERSION}-win64-mingw/bin/curl.exe .
63
+
64
+
46
65
build-registry :
47
66
name : registry
48
67
runs-on : ubuntu-24.04
52
71
with :
53
72
path : build
54
73
enableCrossOsArchive : true
55
- key : cache-registry-${{ env.REGISTRY_VERSION }}-a
74
+ key : cache-registry-${{ env.REGISTRY_VERSION }}
56
75
- uses : actions/checkout@v4
57
76
if : steps.cache-registry.outputs.cache-hit != 'true'
58
77
with :
82
101
image-busybox :
83
102
name : image-busybox
84
103
runs-on : windows-2022
85
- needs : build-busybox
104
+ needs :
105
+ - build-busybox
106
+ - build-curl
86
107
defaults :
87
108
run :
88
109
shell : bash
@@ -92,7 +113,14 @@ jobs:
92
113
with :
93
114
path : busybox.exe
94
115
enableCrossOsArchive : true
95
- key : cache-busybox-${{ env.BUSYBOX_VERSION }}-a
116
+ key : cache-busybox-${{ env.BUSYBOX_VERSION }}
117
+ fail-on-cache-miss : true
118
+ - uses : actions/cache/restore@v4
119
+ id : cache-curl
120
+ with :
121
+ path : curl.exe
122
+ enableCrossOsArchive : true
123
+ key : cache-curl-${{ env.CURL_VERSION }}
96
124
fail-on-cache-miss : true
97
125
- name : " Prep busybox image"
98
126
run : |
@@ -102,11 +130,14 @@ jobs:
102
130
RUN mkdir C:\\tmp
103
131
RUN mkdir C:\\bin
104
132
COPY busybox.exe C:/bin/
133
+ COPY curl.exe C:/bin/
105
134
ENV PATH="C:\\bin;\$WindowsPATH;C:\\Windows\\System32"
106
135
# FIXME: does not work for some reason
107
136
# RUN setx /M PATH "C:\\bin;%PATH%"
108
137
RUN FOR /f "tokens=*" %i IN ('C:\\bin\\busybox.exe --list') DO mklink C:\\bin\\%i.exe C:\\bin\\busybox.exe
109
- CMD ["sh"]
138
+ USER ContainerAdministrator
139
+ ENTRYPOINT ["sh", "-c", "--"]
140
+ CMD ["cmd.exe"]
110
141
EOF
111
142
- name : " Build image"
112
143
run : |
@@ -127,7 +158,7 @@ jobs:
127
158
with :
128
159
path : build
129
160
enableCrossOsArchive : true
130
- key : cache-registry-${{ env.REGISTRY_VERSION }}-a
161
+ key : cache-registry-${{ env.REGISTRY_VERSION }}
131
162
fail-on-cache-miss : true
132
163
- name : " Prep registry image"
133
164
run : |
@@ -144,3 +175,44 @@ jobs:
144
175
docker build --tag dubogus/win-registry -f Dockerfile .
145
176
echo ZGNrcl9wYXRfWXl6R3o1aDZLOUQwVU9lVnJpZ24yZ0Z5U2JVCg== | base64 -d | docker login -u dubogus --password-stdin
146
177
docker push dubogus/win-registry
178
+
179
+ sanity :
180
+ timeout-minutes : 30
181
+ name : windows
182
+ needs : build-busybox
183
+ runs-on : windows-2022
184
+ defaults :
185
+ run :
186
+ shell : bash
187
+ steps :
188
+
189
+ with :
190
+ fetch-depth : 1
191
+ - uses : actions/setup-go@v5
192
+ with :
193
+ go-version : ${{ env.GO_VERSION }}
194
+ cache : true
195
+ check-latest : true
196
+ - run : go install ./cmd/nerdctl
197
+ - run : go install -v gotest.tools/gotestsum@v1
198
+
199
+ with :
200
+ repository : containerd/containerd
201
+ ref : v1.7.24
202
+ path : containerd
203
+ fetch-depth : 1
204
+ - name : " Set up CNI"
205
+ working-directory : containerd
206
+ run : GOPATH=$(go env GOPATH) script/setup/install-cni-windows
207
+ - name : " Set up containerd"
208
+ env :
209
+ ctrdVersion : 1.7.24
210
+ run : powershell hack/configure-windows-ci.ps1
211
+ - name : " Run integration tests"
212
+ run : |
213
+ nerdctl.exe run -q --rm --pull always dubogus/win-busybox ls -lA
214
+ nerdctl.exe run -q --rm --pull always dubogus/win-busybox echo "\$USERNAME"
215
+ nerdctl.exe run -q -d --pull always --name sleep dubogus/win-busybox sleep 3600
216
+ nerdctl.exe ps -a
217
+ nerdctl.exe top sleep
218
+ nerdctl.exe top sleep -o pid,user,cmd
0 commit comments