diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml index 77fdcb1cd..5cff473f1 100644 --- a/.github/workflows/haskell.yml +++ b/.github/workflows/haskell.yml @@ -52,6 +52,14 @@ jobs: uses: input-output-hk/actions/base@latest with: use-sodium-vrf: true + - name: Add LMDB to Nix environment + run: | + nix-env -f '' -iA lmdb + LMDB_STORE=$(find /nix/store -maxdepth 1 -name '*lmdb*-dev' -type d | head -1) + if [ -n "$LMDB_STORE" ]; then + echo "LMDB_PKGCONFIG=${LMDB_STORE}/lib/pkgconfig" >> $GITHUB_ENV + fi + shell: devx {0} - name: cache cabal uses: actions/cache@v3 with: @@ -61,11 +69,17 @@ jobs: key: ${{ env.CABAL_CACHE_VERSION }}-${{ runner.os }}-${{ matrix.compiler-nix-name }}-${{ hashFiles('**/*.cabal', '**/cabal.project', '**/cabal.project.freeze') }} restore-keys: ${{ env.CABAL_CACHE_VERSION }}-${{ runner.os }}-${{ matrix.compiler-nix-name }}- - name: cabal update - run: cabal update + run: | + export PKG_CONFIG_PATH_FOR_TARGET=${{ env.LMDB_PKGCONFIG }}:${PKG_CONFIG_PATH_FOR_TARGET:-} + cabal update - name: cabal build dependencies - run: cabal build all -j --enable-tests --only-dependencies + run: | + export PKG_CONFIG_PATH_FOR_TARGET=${{ env.LMDB_PKGCONFIG }}:${PKG_CONFIG_PATH_FOR_TARGET:-} + cabal build all -j --enable-tests --only-dependencies - name: cabal build - run: cabal build all -j --enable-tests + run: | + export PKG_CONFIG_PATH_FOR_TARGET=${{ env.LMDB_PKGCONFIG }}:${PKG_CONFIG_PATH_FOR_TARGET:-} + cabal build all -j --enable-tests - name: postgres init working-directory: run: | @@ -89,6 +103,7 @@ jobs: start - name: cabal test run: | + export PKG_CONFIG_PATH_FOR_TARGET=${{ env.LMDB_PKGCONFIG }}:${PKG_CONFIG_PATH_FOR_TARGET:-} # Create pgpass file export PGPASSFILE="${PG_DIR}/pgpass-testing" echo "${PG_DIR}:5432:$DBUSER:$DBUSER:*" > $PGPASSFILE