Skip to content

Commit

Permalink
build: Repro build matrix strategy for focal, jammy and noble. ([Elem…
Browse files Browse the repository at this point in the history
…entsProject#7117])

Changelog-None
  • Loading branch information
s373nZ committed Sep 20, 2024
1 parent a0aa0ca commit d8d1a68
Showing 1 changed file with 25 additions and 19 deletions.
44 changes: 25 additions & 19 deletions .github/workflows/repro.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,45 @@ on:
schedule:
- cron: "0 3 * * *"
jobs:
ubuntu-noble:
name: Ubuntu Noble Repro build
ubuntu:
name: "Ubuntu repro build: ${{ matrix.version }}"
runs-on: ubuntu-22.04
strategy:
fail-fast: false # Let each build finish.
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
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 }}
# 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
docker run --rm -v $GITHUB_WORKSPACE:/repo -t cl-release bash -c "\
git --no-pager status > /repo/release/git.log && \
git --no-pager diff >> /repo/release/git.log"
# 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
# Change permissions on the release files for access by the runner environment.
sudo chown -R runner $GITHUB_WORKSPACE/release
- name: Assert clean release
run: |
Expand All @@ -45,10 +53,8 @@ jobs:
ls -al release/clightning-*
if [ -n "$(echo $releasefile | sed -n '/-modded/p')" ]; then
echo "Git Status:"
cat release/git-status.txt
echo "Git Diff:"
cat release/git-diff.txt
echo "Git Status and Diff:"
cat release/git.log
echo 'Error: release modded / dirty tree.'
exit 1
Expand Down

0 comments on commit d8d1a68

Please sign in to comment.