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 f757fd8
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 12 deletions.
37 changes: 25 additions & 12 deletions .github/workflows/repro.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,51 @@ 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']
version: ['focal']
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
run: docker build -t cl-repro-${{ matrix.version }} - < contrib/reprobuild/Dockerfile.${{ matrix.version }}

- name: Create release directory
run: mkdir $GITHUB_WORKSPACE/release

- name: Build using the builder image and store Git state.
- 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 }}
echo "Build complete."
# Commit the image and use it to inspect the Git tree state.
docker commit cl-build cl-release
echo "Docker commit complete."
docker run --rm -v $GITHUB_WORKSPACE:/repo -t cl-release git status > release/git-status.txt
echo "Docker git status complete."
docker run --rm -v $GITHUB_WORKSPACE:/repo -t cl-release git diff > release/git-diff.txt
echo "Docker git diff complete."
# 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
echo "Release chown complete."
- 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/

0 comments on commit f757fd8

Please sign in to comment.