From 84c5807e0ef8bbc811253965498851c37e273122 Mon Sep 17 00:00:00 2001 From: Se7enZ Date: Tue, 17 Sep 2024 13:42:34 +0200 Subject: [PATCH] build: Repro build matrix strategy for focal, jammy and noble. ([#7117]) Changelog-None --- .github/workflows/repro.yml | 44 +++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/.github/workflows/repro.yml b/.github/workflows/repro.yml index 6d84fd31966a..7379b23e03bb 100644 --- a/.github/workflows/repro.yml +++ b/.github/workflows/repro.yml @@ -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: | @@ -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