Skip to content

Commit

Permalink
ci: fix on latest macos
Browse files Browse the repository at this point in the history
  • Loading branch information
4eUeP committed May 17, 2024
1 parent 5cde804 commit b7e6a6d
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@ on:
branches: [main]

jobs:

build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
ghc: ['8.10.7', '9.0.2', '9.2.8', '9.4.5']
cabal: ['3.8']
ghc: ["8.10.7", "9.0.2", "9.2.8", "9.4.8"]
cabal: ["3.8"]
# TODO:
# zk_server: ["3.4.14", "3.6.2"]
# zk_client: ["3.4.14", "3.6.2"]
os: [ubuntu-latest, macOS-latest]

name: ghc-${{ matrix.ghc }} cabal-${{matrix.cabal}} on ${{ matrix.os }}
Expand All @@ -31,21 +34,31 @@ jobs:
restore-keys: |
${{ runner.os }}-${{ matrix.ghc }}-${{ matrix.cabal }}-v1-
# FIXME: use the same client version as the one in the matrix
- name: Install zookeeper-dev on ubuntu
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install libzookeeper-mt-dev
# FIXME: use the same server & client version as the one in the matrix
- name: Install zookeeper-dev on osx
if: runner.os == 'macOS'
run: brew install zookeeper

# FIXME: use the same server version as the one in the matrix
- name: Setup zookeeper server on ubuntu
if: runner.os == 'Linux'
run: docker run --name some-zookeeper -p 2182:2181 -d zookeeper
run: docker run --name some-zookeeper -p 2182:2181 -d zookeeper:3.6
- name: Setup zookeeper server on osx
if: runner.os == 'macOS'
run: |
sed -i'.bak' -e "s/^clientPort=2181$/clientPort=2182/g" /usr/local/etc/zookeeper/zoo.cfg
cat /usr/local/etc/zookeeper/zoo.cfg
# https://docs.brew.sh/Installation
if [ "$(uname -m)" == "arm64" ]; then
sed -i'.bak' -e "s/^clientPort=2181$/clientPort=2182/g" /opt/homebrew/etc/zookeeper/zoo.cfg
cat /opt/homebrew/etc/zookeeper/zoo.cfg
echo "BUILD_ARGS=--extra-include-dirs=/opt/homebrew/include --extra-lib-dirs=/opt/homebrew/lib" >> $GITHUB_ENV
else
sed -i'.bak' -e "s/^clientPort=2181$/clientPort=2182/g" /usr/local/etc/zookeeper/zoo.cfg
cat /usr/local/etc/zookeeper/zoo.cfg
fi
zkServer start
- name: remove xcode devtools on osx
Expand All @@ -69,10 +82,10 @@ jobs:
find $HOME/sdist -maxdepth 1 -type f -name '*.tar.gz' -exec tar -C $GITHUB_WORKSPACE -xzvf {} --strip 1 \;
- name: build
run: cabal build --upgrade-dependencies --enable-tests --enable-benchmarks
run: cabal build ${{ env.BUILD_ARGS }} --upgrade-dependencies --enable-tests --enable-benchmarks

- name: test
run: cabal test --test-show-details=always
run: cabal test ${{ env.BUILD_ARGS }} --test-show-details=always

- name: check
run: cabal check
Expand Down

0 comments on commit b7e6a6d

Please sign in to comment.