Skip to content

Commit 84c5807

Browse files
committed
build: Repro build matrix strategy for focal, jammy and noble. ([#7117])
Changelog-None
1 parent a347aa5 commit 84c5807

File tree

1 file changed

+25
-19
lines changed

1 file changed

+25
-19
lines changed

.github/workflows/repro.yml

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,45 @@ on:
66
schedule:
77
- cron: "0 3 * * *"
88
jobs:
9-
ubuntu-noble:
10-
name: Ubuntu Noble Repro build
9+
ubuntu:
10+
name: "Ubuntu repro build: ${{ matrix.version }}"
1111
runs-on: ubuntu-22.04
12+
strategy:
13+
fail-fast: false # Let each build finish.
14+
matrix:
15+
version: ['focal', 'jammy', 'noble']
1216
steps:
1317
- name: Git checkout
1418
uses: actions/checkout@v2
1519

1620
- name: Build environment setup
1721
run: |
18-
echo "Building base image for noble"
19-
docker run --rm -v $(pwd):/build ubuntu:noble bash -c "apt-get update && apt-get install -y debootstrap && debootstrap noble /build/noble"
20-
tar -C noble -c . | docker import - noble
22+
echo "Building base image for ${{ matrix.version }}"
23+
sudo docker run --rm -v $(pwd):/build ubuntu:${{ matrix.version }} bash -c "\
24+
apt-get update && \
25+
apt-get install -y debootstrap && \
26+
debootstrap ${{ matrix.version }} /build/${{ matrix.version }}"
27+
sudo tar -C ${{ matrix.version }} -c . | docker import - ${{ matrix.version }}
2128
2229
- name: Builder image setup
23-
run: docker build -t cl-repro-noble - < contrib/reprobuild/Dockerfile.noble
30+
run: docker build -t cl-repro-${{ matrix.version }} - < contrib/reprobuild/Dockerfile.${{ matrix.version }}
2431

25-
- name: Create release directory
26-
run: mkdir $GITHUB_WORKSPACE/release
27-
28-
- name: Build using the builder image and store Git state.
32+
- name: Build using the builder image and store Git state
2933
run: |
34+
# Create release directory.
35+
mkdir $GITHUB_WORKSPACE/release
36+
3037
# Perform the repro build.
31-
docker run --name cl-build -v $GITHUB_WORKSPACE:/repo -e FORCE_MTIME=$(date +%F) -t cl-repro-noble
38+
docker run --name cl-build -v $GITHUB_WORKSPACE:/repo -e FORCE_MTIME=$(date +%F) -t cl-repro-${{ matrix.version }}
3239
3340
# Commit the image and use it to inspect the Git tree state.
3441
docker commit cl-build cl-release
35-
docker run --rm -v $GITHUB_WORKSPACE:/repo -t cl-release git status > release/git-status.txt
36-
docker run --rm -v $GITHUB_WORKSPACE:/repo -t cl-release git diff > release/git-diff.txt
42+
docker run --rm -v $GITHUB_WORKSPACE:/repo -t cl-release bash -c "\
43+
git --no-pager status > /repo/release/git.log && \
44+
git --no-pager diff >> /repo/release/git.log"
3745
38-
# Change permissions on the release files for access by build environment.
39-
docker run --rm -v $GITHUB_WORKSPACE:/repo -t cl-repro-noble chmod -R 777 /repo/release
46+
# Change permissions on the release files for access by the runner environment.
47+
sudo chown -R runner $GITHUB_WORKSPACE/release
4048
4149
- name: Assert clean release
4250
run: |
@@ -45,10 +53,8 @@ jobs:
4553
ls -al release/clightning-*
4654
4755
if [ -n "$(echo $releasefile | sed -n '/-modded/p')" ]; then
48-
echo "Git Status:"
49-
cat release/git-status.txt
50-
echo "Git Diff:"
51-
cat release/git-diff.txt
56+
echo "Git Status and Diff:"
57+
cat release/git.log
5258
5359
echo 'Error: release modded / dirty tree.'
5460
exit 1

0 commit comments

Comments
 (0)