-
Notifications
You must be signed in to change notification settings - Fork 4
105 lines (89 loc) · 3.34 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: CI
on:
push:
branches: [main]
pull_request:
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.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]
os: [macOS-latest]
name: ghc-${{ matrix.ghc }} cabal-${{matrix.cabal}} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
#- name: xxx
# run: |
# type clang
# clang --version
# ghc --info
# tree $(brew --prefix llvm@15)
# exit 1
# 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:3.6
- name: Setup zookeeper server on osx
if: runner.os == 'macOS'
run: |
# 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
# if: runner.os == 'macOS'
# run: sudo rm -rf /Library/Developer/CommandLineTools/SDKs
- name: Setup Haskell
uses: haskell-actions/setup@v2
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- uses: actions/cache@v4
with:
path: |
~/.cabal/packages
~/.cabal/store
dist-newstyle
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ matrix.cabal }}-v1-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }}
restore-keys: |
${{ runner.os }}-${{ matrix.ghc }}-${{ matrix.cabal }}-v1-
- name: sdist
run: |
mkdir -p $HOME/sdist
cabal sdist --output-dir $HOME/sdist
- name: unpack
run: |
rm -rf $GITHUB_WORKSPACE/*
find $HOME/sdist -maxdepth 1 -type f -name '*.tar.gz' -exec tar -C $GITHUB_WORKSPACE -xzvf {} --strip 1 \;
- name: build
run: |
export PATH="$(brew --prefix llvm@15):$PATH"
cabal build ${{ env.BUILD_ARGS }} --upgrade-dependencies --enable-tests --enable-benchmarks
- name: test
run: cabal test --enable-tests ${{ env.BUILD_ARGS }} --test-show-details=always
- name: check
run: cabal check
- name: haddock
run: cabal haddock