From 8970953db1aaef58fa46fab92f098876c2c0718d Mon Sep 17 00:00:00 2001 From: Ryan Carsten Schmidt Date: Tue, 23 Apr 2024 18:09:54 -0500 Subject: [PATCH 1/3] Disable silent rules in CI This makes it easier to confirm that the right flags are being passed to the compiler. --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 426793fca..32c2e3879 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,7 +18,7 @@ jobs: - name: autogen run: ./autogen.sh --no-configure - name: configure - run: ./configure + run: ./configure --disable-silent-rules - name: make run: make - name: make check From 6537f9e93c242deb0b8d796ba91e16dc8032e602 Mon Sep 17 00:00:00 2001 From: Ryan Carsten Schmidt Date: Tue, 23 Apr 2024 17:56:25 -0500 Subject: [PATCH 2/3] Add macOS CI Also do CI testing on macOS 12, 13, and 14. Not using "macos-latest" because that currently refers to macOS 12 which is not the latest version. It is good to test on multiple versions and on multiple architectures. The macOS 12 and 13 runners are x86_64 while the macOS 14 runner is arm64. This list can be updated annually as new macOS versions are released and old versions are removed from CI, or switched to "macos-latest" once that actually points to the latest version again. Do not fail fast; this ensures that a build failure on one runner does not cancel the other runners so that temporarily expected failures on one runner do not mask unexpected failures on other runners. Use Homebrew (pre-installed on macOS runners) to install dependencies for macOS. Explicitly mention dependencies that are used, like autoconf, automake, and libtool, even if they are in the set of dependencies already pre-installed on the runners, because who knows if that will always be the case. Fixes #1496 --- .github/workflows/main.yml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 32c2e3879..c9b025853 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,13 +8,24 @@ on: jobs: build: - - runs-on: ubuntu-latest - + strategy: + fail-fast: false + matrix: + os: [macos-12, macos-13, macos-14, ubuntu-latest] + name: ${{ matrix.os }} + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - name: install packages - run: sudo apt-get install autoconf-archive flex libpcre2-dev + run: | + case $RUNNER_OS in + Linux) + sudo apt-get install autoconf autoconf-archive automake flex libpcre2-dev libtool + ;; + macOS) + brew install autoconf autoconf-archive automake pcre2 libtool + ;; + esac - name: autogen run: ./autogen.sh --no-configure - name: configure From e7a90f97d8c38df8c4bda95e7ef9e8810f728bc9 Mon Sep 17 00:00:00 2001 From: Ryan Carsten Schmidt Date: Tue, 23 Apr 2024 18:21:07 -0500 Subject: [PATCH 3/3] Build and test in parallel in CI Build and test in parallel with as many jobs as we have been allocated CPU cores. This should make CI runs faster and provide visibility to parallel build problems. --- .github/workflows/main.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c9b025853..55d154725 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,22 +17,28 @@ jobs: steps: - uses: actions/checkout@v4 - name: install packages + id: info run: | case $RUNNER_OS in Linux) sudo apt-get install autoconf autoconf-archive automake flex libpcre2-dev libtool + cpus=$(nproc) ;; macOS) brew install autoconf autoconf-archive automake pcre2 libtool + cpus=$(sysctl -n hw.activecpu) ;; + *) + cpus=1 esac + echo "cpus=$cpus" >> "$GITHUB_OUTPUT" - name: autogen run: ./autogen.sh --no-configure - name: configure run: ./configure --disable-silent-rules - name: make - run: make + run: make -j${{ steps.info.outputs.cpus }} - name: make check - run: make check + run: make check -j${{ steps.info.outputs.cpus }} - name: make distcheck - run: make distcheck + run: make distcheck -j${{ steps.info.outputs.cpus }}