-
Notifications
You must be signed in to change notification settings - Fork 3
104 lines (91 loc) · 3.24 KB
/
smoke.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
name: Smoke
on:
pull_request:
push:
workflow_dispatch:
defaults:
run:
shell: 'bash -Eeuo pipefail -x {0}'
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
build:
strategy:
matrix:
dist:
- unstable
- bookworm-backports
fail-fast: false
name: ${{ matrix.dist }}
env:
dist: ${{ matrix.dist }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: tianon/debian-moby-action@HEAD # drinking our own champagne
- name: Checkout debian-bin
uses: actions/checkout@v4 # https://github.com/tianon/debian-bin
with:
repository: tianon/debian-bin
ref: de5b30401e07a6bfd537ae64b2a2007b7af70d00
path: .debian-bin
- name: Prepare PATH
run: |
{
echo "$PWD/.debian-bin/generic"
echo "$PWD/.debian-bin/docker-sbuild"
} >> "$GITHUB_PATH"
sudo apt-get update -qq
sudo apt-get install -yqq --no-install-recommends devscripts # uscan
- name: Prepare schroot
run: |
img="debian:$dist"
docker pull "$img"
if [ "$dist" != 'unstable' ]; then
# add my personal backports (especially for newer Go versions)
wget -O tianon-backports.sources "https://apt.tianon.xyz/backports/dists/${dist%-backports}/tianon-backports.sources"
{
printf 'FROM %s\n' "$img"
printf 'RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates && rm -rf /var/lib/apt/lists/*\n'
printf 'COPY tianon-backports.sources /etc/apt/sources.list.d/\n'
} > Dockerfile
img="tianon-backports:$dist"
docker build --tag "$img" .
fi
docker-image-to-sbuild-schroot "$dist.tar" "$img"
- name: Prepare sbuild
run: |
docker-sbuild --pull .built "$dist.tar" --help > /dev/null
- name: GitHub Actions + dpkg-buildpackage slowness workaround...
run: |
# dpkg-genbuildinfo is very slow on GitHub Actions (likely due to the large number of installed packages); it helps these tests a LOT to skip that for our dpkg-buildpackage invocations
gen="$(command -v dpkg-genbuildinfo)"
sudo dpkg-divert --add --rename --divert "$gen.orig" "$gen"
sudo ln -sfT /bin/true "$gen"
# (maybe we should run "dsc-from-source" inside a tiny container instead??)
- name: Prepare dscs
run: |
dsc-from-source .dscs */
- name: sbuild
run: |
for dsc in .dscs/*.dsc; do
dsc="$(readlink -ev "$dsc")"
dir="$(dirname "$dsc")"
dsc="$(basename "$dsc")"
docker-sbuild \
--mount "type=bind,src=$dir,dst=/dsc,ro" \
--workdir /dsc \
.built \
"$dist.tar" \
--arch-all --arch-any --source \
--bd-uninstallable-explainer apt \
--build-dep-resolver aptitude \
--resolve-alternatives \
--verbose \
"$dsc"
done
- name: Test packages
run: |
./test-debs.sh "$dist" .built