From 40dcc5541bf2f65588314d547770456b81fbbf25 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Sat, 7 Jan 2023 17:19:33 +0100 Subject: [PATCH] .github: split build in a regular build+test and weekly distcheck This to save time during regular pushes and pull requests, the tests run from distcheck take a long time, and they're not getting fewer. Signed-off-by: Joachim Wiberg --- .github/workflows/build.yml | 7 +----- .github/workflows/weekly.yml | 47 ++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/weekly.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0edbdff8..7cd6f191 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,7 +40,7 @@ jobs: --enable-x11-common-plugin --with-watchdog --with-keventd make clean make V=1 - - name: Install to ~/tmp + - name: Install to /tmp run: | DESTDIR=/tmp make install-strip tree /tmp || true @@ -59,11 +59,6 @@ jobs: - name: Run Unit Tests run: | make check || (cat test/test-suite.log; false) - - name: Check dist tarball - run: | - ver=$(/tmp/sbin/initctl -V | awk '/Finit.*/ {print $2;}') - dir=finit-$ver/_build/sub - make -j1 distcheck || (cat $dir/test/test-suite.log; false) - name: Upload Test Results uses: actions/upload-artifact@v3 with: diff --git a/.github/workflows/weekly.yml b/.github/workflows/weekly.yml new file mode 100644 index 00000000..beab6871 --- /dev/null +++ b/.github/workflows/weekly.yml @@ -0,0 +1,47 @@ +name: Weekly Distcheck + +# Verify that `make distcheck` works as intended: all tests pass, and +# any new files are distributed in the tarballs +on: + schedule: + - cron: '0 0 * * 0' + +jobs: + schedule: + runs-son: ubuntu-latest + steps: + - name: Create cache file + run: | + mkdir weekly + echo ${{ github.sha }} > weekly/sha.txt + + - name: Check SHA + id: sha + uses: actions/cache@v3 + with: + path: weekly/sha.txt + key: weekly-sha-${{ github.sha }} + + distcheck: + needs: schedule + if: ${{ needs.schedule.sha.outputs.cache-hit != 'true' }} + runs-on: ubuntu-latest + steps: + - name: Install dependencies + run: | + sudo apt-get -y update + sudo apt-get -y install pkg-config jq libuev-dev libite-dev + - uses: actions/checkout@v3 + - name: Base run + run: | + ./autogen.sh + ./configure --prefix=/usr --exec-prefix= --sysconfdir=/etc --localstatedir=/var + make -j9 V=1 + - name: Install to /tmp + run: | + DESTDIR=/tmp make install-strip + - name: Check dist tarball + run: | + ver=$(/tmp/sbin/initctl -V | awk '/Finit.*/ {print $2;}') + dir=finit-$ver/_build/sub + make -j1 distcheck || (cat $dir/test/test-suite.log; false)