From 6537f9e93c242deb0b8d796ba91e16dc8032e602 Mon Sep 17 00:00:00 2001 From: Ryan Carsten Schmidt Date: Tue, 23 Apr 2024 17:56:25 -0500 Subject: [PATCH] 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