From 1d0a3228353207cfe50f00991187c44a7d6a042e Mon Sep 17 00:00:00 2001 From: Gregory Oschwald Date: Tue, 30 Apr 2024 08:54:22 -0700 Subject: [PATCH] Use simpler workaround for Homebrew directory change --- .github/workflows/test-libmaxminddb.yml | 33 ++++++------------------- 1 file changed, 8 insertions(+), 25 deletions(-) diff --git a/.github/workflows/test-libmaxminddb.yml b/.github/workflows/test-libmaxminddb.yml index bfe298b..1ea9ab9 100644 --- a/.github/workflows/test-libmaxminddb.yml +++ b/.github/workflows/test-libmaxminddb.yml @@ -45,35 +45,18 @@ jobs: if: matrix.platform == 'ubuntu-latest' - name: Install libmaxminddb - run: brew install libmaxminddb && brew ls --verbose libmaxminddb - if: matrix.platform == 'macos-latest' + run: brew install libmaxminddb - - name: Build with Werror and Wall (not macOS) - run: python setup.py build - if: matrix.platform != 'macos-latest' - env: - CFLAGS: "-Werror -Wall -Wextra" - - - name: Test with tox (system libmaxminddb) - run: tox - if: matrix.platform != 'macos-latest' + - name: "Work around macos arm64 homebrew directory changes" + if: runner.os == 'macOS' && runner.arch == 'ARM64' + run: | + echo "CFLAGS=-I/opt/homebrew/include" >> $env:GITHUB_ENV + echo "LDFLAGS=-L/opt/homebrew/lib" >> $env:GITHUB_ENV - # Starting at the end of April 2024, the homebrew include and lib - # directories were not properly set up in the flags for the GitHub - # images. I looked for an issue both in Homebrew and actions/runner-images - # and did not find one or similar reports from other users. Setting - # them here seemed easier than digging into it further. It would - # probably be worth trying to remove this in the future. - - name: Build with Werror and Wall (macOS) + - name: Build with Werror and Wall (not macOS) run: python setup.py build - if: matrix.platform == 'macos-latest' env: - CFLAGS: "-Werror -Wall -Wextra -I/opt/homebrew/include" - LDFLAGS: "-L/opt/homebrew/lib" + CFLAGS: "${{ env.CFLAGS }} -Werror -Wall -Wextra" - name: Test with tox (system libmaxminddb) run: tox - if: matrix.platform == 'macos-latest' - env: - CFLAGS: "-I/opt/homebrew/include" - LDFLAGS: "-L/opt/homebrew/lib"