Skip to content

Commit

Permalink
build: Repro build matrix strategy or focal, jammy and noble.
Browse files Browse the repository at this point in the history
  • Loading branch information
s373nZ committed Sep 7, 2024
1 parent 64ff859 commit 5709f9a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
29 changes: 18 additions & 11 deletions .github/workflows/repro.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,45 @@ on:
# 05:00 Berlin, 03:00 UTC, 23:00 New York, 20:00 Los Angeles
schedule:
- cron: "0 3 * * *"
# TODO: remove after testing
push:
branches:
- 7117-repro-nightly-builds
jobs:
ubuntu-noble:
name: Ubuntu Noble Repro build
ubuntu:
name: "Ubuntu repro build: ${{ matrix.version }}"
runs-on: ubuntu-22.04
strategy:
matrix:
version: ['focal', 'jammy', 'noble']
steps:
- name: Git checkout
uses: actions/checkout@v2

- name: Build environment setup
run: |
echo "Building base image for noble"
docker run --rm -v $(pwd):/build ubuntu:noble bash -c "apt-get update && apt-get install -y debootstrap && debootstrap noble /build/noble"
tar -C noble -c . | docker import - noble
echo "Building base image for ${{ matrix.version }}"
sudo docker run --rm -v $(pwd):/build ubuntu:${{ matrix.version }} bash -c "apt-get update && apt-get install -y debootstrap && debootstrap ${{ matrix.version }} /build/${{ matrix.version }}"
sudo tar -C ${{ matrix.version }} -c . | docker import - ${{ matrix.version }}
- name: Builder image setup
run: docker build -t cl-repro-noble - < contrib/reprobuild/Dockerfile.noble

- name: Create release directory
run: mkdir $GITHUB_WORKSPACE/release
run: docker build -t cl-repro-${{ matrix.version }} - < contrib/reprobuild/Dockerfile.${{ matrix.version }}

- name: Build using the builder image and store Git state.
run: |
# Create release directory.
mkdir $GITHUB_WORKSPACE/release
# Perform the repro build.
docker run --name cl-build -v $GITHUB_WORKSPACE:/repo -e FORCE_MTIME=$(date +%F) -t cl-repro-noble
docker run --name cl-build -v $GITHUB_WORKSPACE:/repo -e FORCE_MTIME=$(date +%F) -t cl-repro-${{ matrix.version }}
# Commit the image and use it to inspect the Git tree state.
docker commit cl-build cl-release
docker run --rm -v $GITHUB_WORKSPACE:/repo -t cl-release git status > release/git-status.txt
docker run --rm -v $GITHUB_WORKSPACE:/repo -t cl-release git diff > release/git-diff.txt
# Change permissions on the release files for access by build environment.
docker run --rm -v $GITHUB_WORKSPACE:/repo -t cl-repro-noble chmod -R 777 /repo/release
sudo chown -R runner $GITHUB_WORKSPACE/release
- name: Assert clean release
run: |
Expand Down
1 change: 1 addition & 0 deletions contrib/reprobuild/Dockerfile.focal
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,6 @@ WORKDIR /build
CMD git clone /repo . \
&& poetry export -o requirements.txt --without-hashes \
&& pip install -r requirements.txt \
&& echo "# test: make git tree dirty" >> Cargo.toml \
&& tools/repro-build.sh \
&& cp *.xz /repo/release/
1 change: 1 addition & 0 deletions contrib/reprobuild/Dockerfile.jammy
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,6 @@ WORKDIR /build
CMD git clone /repo . \
&& poetry export -o requirements.txt --without-hashes \
&& pip install -r requirements.txt \
&& echo "# test: make git tree dirty" >> Cargo.toml \
&& tools/repro-build.sh \
&& cp *.xz /repo/release/

0 comments on commit 5709f9a

Please sign in to comment.