Skip to content

Commit

Permalink
nix: update package list from hackage before building
Browse files Browse the repository at this point in the history
This prevents errors in CI after updating the hackage index-state.
  • Loading branch information
wolfgangwalther committed Nov 12, 2024
1 parent 09adb44 commit 3c95d24
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions nix/tools/cabalTools.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ let
withEnv = postgrest.env;
}
''
${cabal-install}/bin/cabal v2-update
exec ${cabal-install}/bin/cabal v2-build ${devCabalOptions} "''${_arg_leftovers[@]}"
'';

Expand Down
1 change: 1 addition & 0 deletions nix/tools/devTools.nix
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ let
}
''
mkdir -p "$_arg_dumpdir"
${cabal-install}/bin/cabal v2-update
${cabal-install}/bin/cabal v2-build ${devCabalOptions} \
--builddir="$tmpdir" \
--ghc-option=-ddump-minimal-imports \
Expand Down
8 changes: 8 additions & 0 deletions nix/tools/tests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ let
withEnv = postgrest.env;
}
''
${cabal-install}/bin/cabal v2-update
${withTools.withPg} -f test/spec/fixtures/load.sql \
${cabal-install}/bin/cabal v2-run ${devCabalOptions} test:spec -- "''${_arg_leftovers[@]}"
'';
Expand All @@ -40,6 +41,7 @@ let
withEnv = postgrest.env;
}
''
${cabal-install}/bin/cabal v2-update
# This makes nix-env -iA tests.doctests.bin work.
export NIX_GHC=${postgrest.env.NIX_GHC}
${cabal-install}/bin/cabal v2-run ${devCabalOptions} test:doctests
Expand All @@ -54,6 +56,7 @@ let
withEnv = postgrest.env;
}
''
${cabal-install}/bin/cabal v2-update
${withTools.withPg} -f test/spec/fixtures/load.sql \
${runtimeShell} -c " \
${cabal-install}/bin/cabal v2-run ${devCabalOptions} test:spec && \
Expand Down Expand Up @@ -81,6 +84,7 @@ let
withEnv = postgrest.env;
}
''
${cabal-install}/bin/cabal v2-update
${cabal-install}/bin/cabal v2-build ${devCabalOptions}
${cabal-install}/bin/cabal v2-exec -- ${withTools.withPg} -f test/io/fixtures.sql \
${ioTestPython}/bin/pytest --ignore=test/io/test_big_schema.py --ignore=test/io/test_replica.py -v test/io "''${_arg_leftovers[@]}"
Expand All @@ -96,6 +100,7 @@ let
withEnv = postgrest.env;
}
''
${cabal-install}/bin/cabal v2-update
${cabal-install}/bin/cabal v2-build ${devCabalOptions}
${cabal-install}/bin/cabal v2-exec -- ${withTools.withPg} -f test/io/big_schema.sql \
${ioTestPython}/bin/pytest -v test/io/test_big_schema.py "''${_arg_leftovers[@]}"
Expand All @@ -111,6 +116,7 @@ let
withEnv = postgrest.env;
}
''
${cabal-install}/bin/cabal v2-update
${cabal-install}/bin/cabal v2-build ${devCabalOptions}
${cabal-install}/bin/cabal v2-exec -- ${withTools.withPg} --replica -f test/io/replica.sql \
${ioTestPython}/bin/pytest -v test/io/test_replica.py "''${_arg_leftovers[@]}"
Expand All @@ -126,6 +132,7 @@ let
withPath = [ jq ];
}
''
${cabal-install}/bin/cabal v2-update
${withTools.withPg} -f test/spec/fixtures/load.sql \
${cabal-install}/bin/cabal v2-run ${devCabalOptions} --verbose=0 -- \
postgrest --dump-schema
Expand Down Expand Up @@ -154,6 +161,7 @@ let
rm -rf coverage/*
# build once before running all the tests
${cabal-install}/bin/cabal v2-update
${cabal-install}/bin/cabal v2-build ${devCabalOptions} exe:postgrest lib:postgrest test:spec
(
Expand Down

0 comments on commit 3c95d24

Please sign in to comment.