-
Notifications
You must be signed in to change notification settings - Fork 12
456 lines (433 loc) · 16.5 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
name: Testing
on:
pull_request:
push:
paths-ignore: [LICENSE, README.md]
jobs:
apt-opts:
needs: [single-package]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./
env:
DEB_BUILD_OPTIONS: noautodbgsym
with:
apt-opts: --install-recommends --no-install-suggests
buildpackage-opts: --build=binary --no-sign
source-dir: test
- run: |
dpkg --info debian/artifacts/test_1_amd64.deb
dpkg --contents debian/artifacts/test_1_amd64.deb | grep ./usr/bin/mybin
test -f debian/artifacts/test_1_amd64.buildinfo
test -f debian/artifacts/test_1_amd64.changes
before-build-hook:
needs: [single-package]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./
env:
DEB_BUILD_OPTIONS: noautodbgsym
with:
before-build-hook: |
cd test
dch --maintmaint --newversion 2 "Version 2"
dch --maintmaint --release ""
buildpackage-opts: --build=binary --no-sign
extra-build-deps: devscripts
source-dir: test
- run: |
dpkg --info debian/artifacts/test_2_amd64.deb
dpkg --contents debian/artifacts/test_2_amd64.deb | grep ./usr/bin/mybin
test -f debian/artifacts/test_2_amd64.buildinfo
test -f debian/artifacts/test_2_amd64.changes
default-source-dir:
needs: [single-package]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: cp -r test/* .
- uses: ./
env:
DEB_BUILD_OPTIONS: noautodbgsym
with:
buildpackage-opts: --build=binary --no-sign
- run: |
dpkg --info debian/artifacts/test_1_amd64.deb
dpkg --contents debian/artifacts/test_1_amd64.deb | grep ./usr/bin/mybin
test -f debian/artifacts/test_1_amd64.buildinfo
test -f debian/artifacts/test_1_amd64.changes
different-artifacts-dir:
needs: [single-package]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./
env:
DEB_BUILD_OPTIONS: noautodbgsym
with:
artifacts-dir: my_artifacts
buildpackage-opts: --build=binary --no-sign
source-dir: test
- run: |
dpkg --info my_artifacts/test_1_amd64.deb
dpkg --contents my_artifacts/test_1_amd64.deb | grep ./usr/bin/mybin
test -f my_artifacts/test_1_amd64.buildinfo
test -f my_artifacts/test_1_amd64.changes
different-docker-image:
needs: [single-package]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./
env:
DEB_BUILD_OPTIONS: noautodbgsym
with:
buildpackage-opts: --build=binary --no-sign
docker-image: ubuntu:latest
source-dir: test
- run: |
dpkg --info debian/artifacts/test_1_amd64.deb
dpkg --contents debian/artifacts/test_1_amd64.deb | grep ./usr/bin/mybin
test -f debian/artifacts/test_1_amd64.buildinfo
test -f debian/artifacts/test_1_amd64.changes
different-host-arch:
needs: [single-package]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./
env:
DEB_BUILD_OPTIONS: noautodbgsym
with:
buildpackage-opts: --build=binary --no-sign
host-arch: i386
source-dir: test
- run: |
dpkg --info debian/artifacts/test_1_i386.deb
dpkg --contents debian/artifacts/test_1_i386.deb | grep ./usr/bin/mybin
test -f debian/artifacts/test_1_i386.buildinfo
test -f debian/artifacts/test_1_i386.changes
extra-build-deps:
needs: [single-package]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: cat test/Makefile_extra-build-deps >> test/Makefile
- uses: ./
env:
DEB_BUILD_OPTIONS: noautodbgsym
with:
buildpackage-opts: --build=binary --no-sign
# Install an extra package unlikely to be ever installed by default:
extra-build-deps: libzt1
source-dir: test
- run: |
dpkg --info debian/artifacts/test_1_amd64.deb
dpkg --contents debian/artifacts/test_1_amd64.deb | grep ./usr/bin/mybin
test -f debian/artifacts/test_1_amd64.buildinfo
test -f debian/artifacts/test_1_amd64.changes
extra-docker-args:
needs: [single-package]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: cat test/Makefile_extra-docker-args >> test/Makefile
- uses: ./
env:
DEB_BUILD_OPTIONS: noautodbgsym
with:
buildpackage-opts: --build=binary --no-sign
source-dir: test
extra-docker-args: --add-host extra-args-test:127.0.0.1
- run: |
dpkg --info debian/artifacts/test_1_amd64.deb
dpkg --contents debian/artifacts/test_1_amd64.deb | grep ./usr/bin/mybin
test -f debian/artifacts/test_1_amd64.buildinfo
test -f debian/artifacts/test_1_amd64.changes
extra-repo-keys-ascii:
needs: [single-package]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: download-keys
run: |
docker run --detach --mount="type=bind,src=${{ github.workspace }},dst=/workspace" --name=download-cont --rm --workdir=/workspace debian:stable-slim tail -f /dev/null
docker exec download-cont apt-get update
docker exec --user="$(id -u):$(id -g)" download-cont apt-get download debian-archive-keyring
docker stop --time=1 download-cont
dpkg-deb --extract debian-archive-keyring_*.deb debian-archive-keyring
{
printf 'debian-archive-keys<<EOF\n'
cat debian-archive-keyring/etc/apt/trusted.gpg.d/*.asc
printf 'EOF\n'
} >>"$GITHUB_OUTPUT"
- uses: ./
env:
DEB_BUILD_OPTIONS: noautodbgsym
with:
buildpackage-opts: --build=binary --no-sign
docker-image: test/Dockerfile_extra-repo-keys
# An output value instead of an environment variable is used here to
# not interfere with Docker’s environment down the line.
extra-repo-keys: ${{ steps.download-keys.outputs.debian-archive-keys }}
source-dir: test
- run: |
dpkg --info debian/artifacts/test_1_amd64.deb
dpkg --contents debian/artifacts/test_1_amd64.deb | grep ./usr/bin/mybin
test -f debian/artifacts/test_1_amd64.buildinfo
test -f debian/artifacts/test_1_amd64.changes
extra-repo-keys-files:
needs: [single-package]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: download-keys
run: |
docker run --detach --mount="type=bind,src=${{ github.workspace }},dst=/workspace" --name=download-cont --rm --workdir=/workspace debian:stable-slim tail -f /dev/null
docker exec download-cont apt-get update
docker exec --user="$(id -u):$(id -g)" download-cont apt-get download debian-archive-keyring
docker stop --time=1 download-cont
dpkg-deb --extract debian-archive-keyring_*.deb debian-archive-keyring
{
printf 'debian-archive-keys<<EOF\n'
ls -1 --directory debian-archive-keyring/etc/apt/trusted.gpg.d/*.asc
printf 'EOF\n'
} >>"$GITHUB_OUTPUT"
- uses: ./
env:
DEB_BUILD_OPTIONS: noautodbgsym
with:
buildpackage-opts: --build=binary --no-sign
docker-image: test/Dockerfile_extra-repo-keys
# An output value instead of an environment variable is used here to
# not interfere with Docker’s environment down the line.
extra-repo-keys: ${{ steps.download-keys.outputs.debian-archive-keys }}
source-dir: test
- run: |
dpkg --info debian/artifacts/test_1_amd64.deb
dpkg --contents debian/artifacts/test_1_amd64.deb | grep ./usr/bin/mybin
test -f debian/artifacts/test_1_amd64.buildinfo
test -f debian/artifacts/test_1_amd64.changes
extra-repos:
needs: [setup-hook]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: cat test/Makefile_extra-repos >>test/Makefile
- uses: ./
env:
DEB_BUILD_OPTIONS: noautodbgsym
with:
buildpackage-opts: --build=binary --no-sign
extra-repos: |
# These are intentionally given as two entries:
deb http://deb.debian.org/debian stable contrib
deb http://deb.debian.org/debian stable non-free
setup-hook: |
apt-get update # Called here manually only for testing purposes!
! apt-cache policy | grep -E ' *release.*[ ,]o=Debian[,$$]' | grep -E '[ ,]c=contrib[,$$]'
! apt-cache policy | grep -E ' *release.*[ ,]o=Debian[,$$]' | grep -E '[ ,]c=non-free[,$$]'
source-dir: test
- run: |
dpkg --info debian/artifacts/test_1_amd64.deb
dpkg --contents debian/artifacts/test_1_amd64.deb | grep ./usr/bin/mybin
test -f debian/artifacts/test_1_amd64.buildinfo
test -f debian/artifacts/test_1_amd64.changes
extra-repos-deb822:
needs: [setup-hook]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: cat test/Makefile_extra-repos >>test/Makefile
- uses: ./
env:
DEB_BUILD_OPTIONS: noautodbgsym
with:
buildpackage-opts: --build=binary --no-sign
extra-repos: |
# These are intentionally given as two entries:
Types: deb
URIs: http://deb.debian.org/debian
Suites: stable
Components: contrib
Types: deb
URIs: http://deb.debian.org/debian
Suites: stable
Components: non-free
setup-hook: |
apt-get update # Called here manually only for testing purposes!
! apt-cache policy | grep -E ' *release.*[ ,]o=Debian[,$$]' | grep -E '[ ,]c=contrib[,$$]'
! apt-cache policy | grep -E ' *release.*[ ,]o=Debian[,$$]' | grep -E '[ ,]c=non-free[,$$]'
source-dir: test
- run: |
dpkg --info debian/artifacts/test_1_amd64.deb
dpkg --contents debian/artifacts/test_1_amd64.deb | grep ./usr/bin/mybin
test -f debian/artifacts/test_1_amd64.buildinfo
test -f debian/artifacts/test_1_amd64.changes
full-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./
env:
DEB_BUILD_OPTIONS: noautodbgsym
with:
buildpackage-opts: --build=full --no-sign
source-dir: test
- run: |
dpkg --info debian/artifacts/test_1_amd64.deb
dpkg --contents debian/artifacts/test_1_amd64.deb | grep ./usr/bin/mybin
test -f debian/artifacts/test_1.dsc
test -f debian/artifacts/test_1.tar.xz
test -f debian/artifacts/test_1_amd64.buildinfo
test -f debian/artifacts/test_1_amd64.changes
git-as-root-in-hook:
needs: [before-build-hook]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./
env:
DEB_BUILD_OPTIONS: noautodbgsym
with:
before-build-hook: |
cd test
# Using `git rev-parse` here instead of github.sha to specifically
# test the git usage.
rev=$(git rev-parse HEAD)
dch --maintmaint --newversion "1+$rev" "Version 1+$rev"
dch --maintmaint --release ""
buildpackage-opts: --build=binary --no-sign
extra-build-deps: devscripts git
source-dir: test
- run: |
dpkg --info debian/artifacts/test_1+${{ github.sha }}_amd64.deb
dpkg --contents debian/artifacts/test_1+${{ github.sha }}_amd64.deb | grep ./usr/bin/mybin
test -f debian/artifacts/test_1+${{ github.sha }}_amd64.buildinfo
test -f debian/artifacts/test_1+${{ github.sha }}_amd64.changes
local-dockerfile:
needs: [single-package]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: cat test/Makefile_local-dockerfile >> test/Makefile
- uses: ./
env:
DEB_BUILD_OPTIONS: noautodbgsym
with:
buildpackage-opts: --build=binary --no-sign
docker-image: test/Dockerfile
source-dir: test
- run: |
dpkg --info debian/artifacts/test_1_amd64.deb
dpkg --contents debian/artifacts/test_1_amd64.deb | grep ./usr/bin/mybin
test -f debian/artifacts/test_1_amd64.buildinfo
test -f debian/artifacts/test_1_amd64.changes
multiple-packages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./
with:
buildpackage-opts: --build=binary --no-sign
source-dir: test
- run: |
dpkg --info debian/artifacts/test_1_amd64.deb
dpkg --info debian/artifacts/test-dbgsym_1_amd64.deb
dpkg --contents debian/artifacts/test_1_amd64.deb | grep ./usr/bin/mybin
dpkg --contents debian/artifacts/test-dbgsym_1_amd64.deb
test -f debian/artifacts/test_1_amd64.buildinfo
test -f debian/artifacts/test_1_amd64.changes
# Regression test following issue #3 (“Did not find the .buildinfo file in
# debian/files”)
non-trivial-package-version:
needs: [single-package]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
sed -i '1 s/\(1\)/4.3.2-1+final~42-5.deb+long~version/' test/debian/changelog
sed -i 's/native/quilt/' test/debian/source/format
- uses: ./
env:
DEB_BUILD_OPTIONS: noautodbgsym
with:
buildpackage-opts: --build=binary --no-sign
source-dir: test
- run: |
dpkg --info debian/artifacts/test_4.3.2-1+final~42-5.deb+long~version_amd64.deb
dpkg --contents debian/artifacts/test_4.3.2-1+final~42-5.deb+long~version_amd64.deb | grep ./usr/bin/mybin
test -f debian/artifacts/test_4.3.2-1+final~42-5.deb+long~version_amd64.buildinfo
test -f debian/artifacts/test_4.3.2-1+final~42-5.deb+long~version_amd64.changes
not-moving-artifacts:
needs: [single-package]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./
env:
DEB_BUILD_OPTIONS: noautodbgsym
with:
artifacts-dir: .
buildpackage-opts: --build=binary --no-sign
source-dir: test
- run: |
dpkg --info test_1_amd64.deb
dpkg --contents test_1_amd64.deb | grep ./usr/bin/mybin
test -f test_1_amd64.buildinfo
test -f test_1_amd64.changes
setup-hook:
needs: [single-package]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: cat test/Makefile_setup-hook >>test/Makefile
- uses: ./
env:
DEB_BUILD_OPTIONS: noautodbgsym
with:
setup-hook: |
cat <<EOF >/etc/apt/preferences
Package: *
Pin: release o=Debian
Pin-Priority: 666
EOF
buildpackage-opts: --build=binary --no-sign
source-dir: test
- run: |
dpkg --info debian/artifacts/test_1_amd64.deb
dpkg --contents debian/artifacts/test_1_amd64.deb | grep ./usr/bin/mybin
test -f debian/artifacts/test_1_amd64.buildinfo
test -f debian/artifacts/test_1_amd64.changes
single-package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./
env:
DEB_BUILD_OPTIONS: noautodbgsym
with:
buildpackage-opts: --build=binary --no-sign
source-dir: test
- run: |
test "$(ls -1 debian/artifacts/*.deb | wc -l)" = 1
dpkg --info debian/artifacts/test_1_amd64.deb
dpkg --contents debian/artifacts/test_1_amd64.deb | grep ./usr/bin/mybin
test -f debian/artifacts/test_1_amd64.buildinfo
test -f debian/artifacts/test_1_amd64.changes
source-package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./
with:
buildpackage-opts: --build=source --no-sign
source-dir: test
- run: |
! ls -1 debian/artifacts/*.deb 2>/dev/null
test -f debian/artifacts/test_1.dsc
test -f debian/artifacts/test_1.tar.xz
test -f debian/artifacts/test_1_source.buildinfo
test -f debian/artifacts/test_1_source.changes