Repro nightly builds #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | ||
# https://docs.corelightning.org/docs/repro | ||
name: Repro Build Nightly | ||
on: | ||
# 05:00 Berlin, 03:00 UTC, 23:00 New York, 20:00 Los Angeles | ||
schedule: | ||
- cron: "0 3 * * *" | ||
jobs: | ||
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 ${{ 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-${{ 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-${{ 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 --no-pager status > release/git-status.txt | ||
docker run --rm -v $GITHUB_WORKSPACE:/repo -t cl-release git --no-pager diff > release/git-diff.txt | ||
# Change permissions on the release files for access by the runner environment. | ||
sudo chown -R runner $GITHUB_WORKSPACE/release | ||
- name: Assert clean release | ||
run: | | ||
releasefile=$(ls release/clightning-*) | ||
echo 'Release file:' | ||
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 'Error: release modded / dirty tree.' | ||
exit 1 | ||
else | ||
echo 'Success! Clean release.' | ||
fi |