Skip to content

Commit 1b3a125

Browse files
committed
fix: CI add missing lmdb dependency to devx shell
1 parent 2187c9c commit 1b3a125

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

.github/workflows/haskell.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@ jobs:
5252
uses: input-output-hk/actions/base@latest
5353
with:
5454
use-sodium-vrf: true
55+
- name: Add LMDB to Nix environment
56+
run: |
57+
nix-env -f '<nixpkgs>' -iA lmdb
58+
LMDB_STORE=$(find /nix/store -maxdepth 1 -name '*lmdb*-dev' -type d | head -1)
59+
if [ -n "$LMDB_STORE" ]; then
60+
echo "LMDB_PKGCONFIG=${LMDB_STORE}/lib/pkgconfig" >> $GITHUB_ENV
61+
fi
62+
shell: devx {0}
5563
- name: cache cabal
5664
uses: actions/cache@v3
5765
with:
@@ -61,11 +69,17 @@ jobs:
6169
key: ${{ env.CABAL_CACHE_VERSION }}-${{ runner.os }}-${{ matrix.compiler-nix-name }}-${{ hashFiles('**/*.cabal', '**/cabal.project', '**/cabal.project.freeze') }}
6270
restore-keys: ${{ env.CABAL_CACHE_VERSION }}-${{ runner.os }}-${{ matrix.compiler-nix-name }}-
6371
- name: cabal update
64-
run: cabal update
72+
run: |
73+
export PKG_CONFIG_PATH_FOR_TARGET=${{ env.LMDB_PKGCONFIG }}:${PKG_CONFIG_PATH_FOR_TARGET:-}
74+
cabal update
6575
- name: cabal build dependencies
66-
run: cabal build all -j --enable-tests --only-dependencies
76+
run: |
77+
export PKG_CONFIG_PATH_FOR_TARGET=${{ env.LMDB_PKGCONFIG }}:${PKG_CONFIG_PATH_FOR_TARGET:-}
78+
cabal build all -j --enable-tests --only-dependencies
6779
- name: cabal build
68-
run: cabal build all -j --enable-tests
80+
run: |
81+
export PKG_CONFIG_PATH_FOR_TARGET=${{ env.LMDB_PKGCONFIG }}:${PKG_CONFIG_PATH_FOR_TARGET:-}
82+
cabal build all -j --enable-tests
6983
- name: postgres init
7084
working-directory:
7185
run: |
@@ -89,6 +103,7 @@ jobs:
89103
start
90104
- name: cabal test
91105
run: |
106+
export PKG_CONFIG_PATH_FOR_TARGET=${{ env.LMDB_PKGCONFIG }}:${PKG_CONFIG_PATH_FOR_TARGET:-}
92107
# Create pgpass file
93108
export PGPASSFILE="${PG_DIR}/pgpass-testing"
94109
echo "${PG_DIR}:5432:$DBUSER:$DBUSER:*" > $PGPASSFILE

0 commit comments

Comments
 (0)