-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (69 loc) · 2.45 KB
/
Copy pathdocker-reproducibility.yml
File metadata and controls
80 lines (69 loc) · 2.45 KB
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
# SPDX-FileCopyrightText: 2026 Alexandre Gomes Gaigalas <alganet@gmail.com>
# SPDX-License-Identifier: ISC
name: Reproducibility check (temporary workflow)
on:
pull_request:
branches:
- "main"
permissions:
contents: read
jobs:
check:
runs-on: ubuntu-24.04
timeout-minutes: 360
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/downloads
- name: Initialize report
run: |
echo "shell reproducibility report" > repro-report.txt
echo "generated on $(date)" >> repro-report.txt
echo >> repro-report.txt
- name: Determine build targets
run: |
# convert newline-separated list to space-separated so build-arg works
t=$(sh shvr.sh targets | tr '\n' ' ')
echo "TARGETS=$t" >> $GITHUB_ENV
- name: Build image (first pass)
run: |
docker buildx build --load --progress=plain -t repro:1 \
--build-arg TARGETS="$TARGETS" .
- name: Build image (second pass)
run: |
docker buildx build --load --progress=plain -t repro:2 \
--build-arg TARGETS="$TARGETS" .
- name: Extract filesystem snapshots
run: |
mkdir -p /tmp/opt1 /tmp/opt2
docker create --name c1 repro:1 || true
docker cp c1:/opt /tmp/opt1
docker rm -f c1 || true
docker create --name c2 repro:2 || true
docker cp c2:/opt /tmp/opt2
docker rm -f c2 || true
- name: Compare binary checksums
run: |
echo "Image reproducibility report" >> repro-report.txt
echo >> repro-report.txt
for bin in $(find /tmp/opt1 -type f -executable); do
rel=${bin#/tmp/opt1/}
h1=$(sha256sum "$bin" | awk '{print $1}')
if [ -f "/tmp/opt2/$rel" ]; then
h2=$(sha256sum "/tmp/opt2/$rel" | awk '{print $1}')
else
h2="<missing>"
fi
if [ "$h1" = "$h2" ]; then
echo "$rel: reproducible $h1" >> repro-report.txt
else
echo "$rel: NONREPRO $h1 $h2" >> repro-report.txt
fi
done
echo >> repro-report.txt
echo "Summary:" >> repro-report.txt
grep -c "NONREPRO" repro-report.txt >> repro-report.txt || true
- name: Upload artifact
uses: actions/upload-artifact@v6
with:
name: reproducibility-report
path: repro-report.txt