Skip to content

Commit cbcc16b

Browse files
committed
Use homebrew and pkg-config depending on the OS
1 parent a92980b commit cbcc16b

File tree

3 files changed

+24
-4
lines changed

3 files changed

+24
-4
lines changed

.github/workflows/one-time-password.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,34 @@ jobs:
3030
steps:
3131
- name: Checkout base repo
3232
uses: actions/checkout@v4
33+
3334
- name: Set up Haskell
3435
id: setup-haskell
3536
uses: haskell-actions/setup@v2
3637
with:
3738
ghc-version: ${{ matrix.ghc }}
3839
cabal-version: 'latest'
40+
3941
- name: Configure
4042
run: |
4143
./.github/workflows/install-libsodium.sh
4244
cabal freeze
45+
4346
- name: Cache
4447
uses: actions/cache@v4
4548
with:
4649
path: ${{ steps.setup-haskell.outputs.cabal-store }}
4750
key: ${{ runner.os }}-ghc-${{ matrix.ghc }}-cabal-${{ hashFiles('**/plan.json') }}
4851
restore-keys: ${{ runner.os }}-ghc-${{ matrix.ghc }}-
49-
- name: Build
50-
run: cabal build
51-
- name: Test
52-
run: cabal test
52+
53+
- name: Test with homebrew on macOS
54+
if: ${{ matrix.os == 'macos-latest' }}
55+
run: |
56+
cabal build --project-file=cabal.homebrew.project -v2 all
57+
cabal test --project-file=cabal.homebrew.project all
58+
59+
- name: Test with pkg-config
60+
if: ${{ matrix.os == 'ubuntu-latest' }}
61+
run: |
62+
cabal build --project-file=cabal.pkg-config.project -v2 all
63+
cabal test --project-file=cabal.pkg-config.project all

cabal.homebrew.project

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import: ./cabal.project
2+
3+
package libsodium-bindings
4+
flags: +homebrew -pkg-config

cabal.pkg-config.project

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import: ./cabal.project
2+
3+
package libsodium-bindings
4+
flags: -homebrew +pkg-config
5+

0 commit comments

Comments
 (0)