-
Notifications
You must be signed in to change notification settings - Fork 2
72 lines (60 loc) · 1.86 KB
/
haskell.yml
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
name: Haskell CI
on:
pull_request:
push:
branches: [ "main" ]
permissions:
contents: read
jobs:
build:
env:
cabal-build-dir: _build
runs-on: ubuntu-latest
steps:
- name: ✅ Checkout
uses: actions/checkout@v4
- name: 🌳 Environment
uses: haskell-actions/setup@v2
id: setup-haskell-cabal
with:
ghc-version: '9.8.2'
cabal-version: '3.10.1.0'
- name: 🧊 Freeze
working-directory: haskell
run: |
cabal freeze --builddir=${{ env.cabal-build-dir }}
- name: 🚪 Cache
uses: actions/cache@v4
env:
hash: ${{ hashFiles('cabal.project.freeze') }}
with:
key: ${{ matrix.os }}-ghc-${{ matrix.ghc }}-${{ env.hash }}
restore-keys: |
${{ matrix.os }}-ghc-${{ matrix.ghc }}-
path: |
${{ steps.setup-haskell-cabal.outputs.cabal-store }}
${{ env.cabal-build-dir }}
- name: ❄ Install libsodium
working-directory: haskell
run: |
git clone https://github.com/input-output-hk/libsodium
cd libsodium
git checkout dbb48cc
./autogen.sh
./configure
make
sudo make install
- name: 🪨 Install dependencies
working-directory: haskell
run: |
cabal update
cabal build --only-dependencies --enable-tests --enable-benchmarks
- name: 🏠 Build
working-directory: haskell
env:
LD_LIBRARY_PATH: "/usr/local/lib:$LD_LIBRARY_PATH"
PKG_CONFIG_PATH: "/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH"
run: cabal build --enable-tests --enable-benchmarks --extra-include-dirs=/usr/local/include --extra-lib-dirs=/usr/local/lib all
- name: 🧪 Run tests
working-directory: haskell
run: cabal test --extra-include-dirs=/usr/local/include --extra-lib-dirs=/usr/local/lib all