Skip to content

Commit

Permalink
GHA: Test Homebrew in different prefixes
Browse files Browse the repository at this point in the history
This is to test that if the Homebrew prefix is not `/usr/local`, then
setting `LIBRARY_PATH` is not needed and `autotool` will using
`pkg-config` to find the libraries.
  • Loading branch information
zmughal committed Jan 13, 2022
1 parent 98f1723 commit 3cbd03b
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,37 @@ jobs:
# - false: automatically configure X11
# - true: disable building with X11 (use --without-x option)
without-x: [false,true]
# used for macos runner
homebrew-prefix: [ '/usr/local' ]
include:
- os: macos-latest
homebrew-prefix: '/Users/runner/homebrew'
without-x: false
steps:
- uses: actions/checkout@v2
- name: Pre-reqs (apt)
if: runner.os == 'Linux'
run: |
sudo apt-get -y update && sudo apt-get install build-essential \
libpng-dev zlib1g-dev libx11-dev libxaw7-dev libxt-dev x11proto-core-dev libgif-dev
- name: Prepare Homebrew
if: runner.os == 'macOS'
run: |
echo "Using Homebrew prefix: ${{ matrix.homebrew-prefix }}"
if [ "${{ matrix.homebrew-prefix }}" = "/usr/local" ]; then
echo "LIBRARY_PATH=$(brew --prefix)/lib${LIBRARY_PATH:+:${LIBRARY_PATH}}" >> $GITHUB_ENV
else
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
git clone https://github.com/Homebrew/brew.git "${{ matrix.homebrew-prefix }}"
echo "${{ matrix.homebrew-prefix }}/bin" >> $GITHUB_PATH
fi
- name: Pre-reqs (homebrew)
if: runner.os == 'macOS'
run: |
brew reinstall gfortran
brew install automake \
libpng \
libxt
echo "LIBRARY_PATH=$(brew --prefix)/lib${LIBRARY_PATH:+:${LIBRARY_PATH}}" >> $GITHUB_ENV
- name: Bootstrap
run: |
sh ./bootstrap
Expand Down

0 comments on commit 3cbd03b

Please # to comment.