Skip to content

Commit 814c838

Browse files
s373nZShahanaFarooqui
authored andcommitted
build: Repro build matrix strategy for focal, jammy and noble. ([#7117])
Changelog-None
1 parent f7d3b0b commit 814c838

File tree

1 file changed

+20
-13
lines changed

1 file changed

+20
-13
lines changed

.github/workflows/repro.yml

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,36 @@ 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@v4
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, storing version and 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 in order to inspect the build later.
3441
docker commit cl-build cl-release
@@ -41,8 +48,8 @@ jobs:
4148
git --no-pager status > /repo/release/git.log && \
4249
git --no-pager diff >> /repo/release/git.log"
4350
44-
# Change permissions on the release files for access by build environment.
45-
docker run --rm -v $GITHUB_WORKSPACE:/repo -t cl-repro-noble chmod -R 777 /repo/release
51+
# Change permissions on the release files for access by the runner environment.
52+
sudo chown -R runner $GITHUB_WORKSPACE/release
4653
4754
- name: Assert clean version and release
4855
run: |

0 commit comments

Comments
 (0)