diff --git a/.circleci/config.yml b/.circleci/config.yml index 5d00d0845..5fce6c718 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -67,6 +67,8 @@ jobs: name: run spec tests command: | test/create_test_db "postgres://circleci@localhost" postgrest_test stack test + - store_artifacts: + path: /tmp/postgrest # Publish a new release. This only runs when a release is tagged (see # workflow below). @@ -111,6 +113,8 @@ jobs: then postgrest-release-dockerhub-description fi + - store_artifacts: + path: /tmp/postgrest # Build everything in default.nix and push to the Cachix binary cache if running on main nix-build: @@ -154,6 +158,8 @@ jobs: echo "Building all derivations (caching skipped for outside pull requests)..." nix-build fi + - store_artifacts: + path: /tmp/postgrest # Run tests nix-test: @@ -218,7 +224,8 @@ jobs: name: Run memory tests command: postgrest-test-memory when: always - + - store_artifacts: + path: /tmp/postgrest workflows: version: 2 diff --git a/nix/overlays/checked-shell-script/checked-shell-script.nix b/nix/overlays/checked-shell-script/checked-shell-script.nix index 5deb12749..ae0af139c 100644 --- a/nix/overlays/checked-shell-script/checked-shell-script.nix +++ b/nix/overlays/checked-shell-script/checked-shell-script.nix @@ -3,6 +3,7 @@ # to be used in a path for example. { argbash , bash_5 +, coreutils , git , lib , runCommand @@ -83,7 +84,7 @@ let + lib.optionalString redirectTixFiles '' # storing tix files in a temporary throw away directory avoids mix/tix conflicts after changes - hpctixdir=$(mktemp -d) + hpctixdir=$(${coreutils}/bin/mktemp -d) export HPCTIXFILE="$hpctixdir"/postgrest.tix trap 'rm -rf $hpctixdir' EXIT '' @@ -99,7 +100,8 @@ let '' + lib.optionalString withTmpDir '' - tmpdir="$(mktemp -d)" + mkdir -p "''${TMPDIR:-/tmp}/postgrest" + tmpdir="$(${coreutils}/bin/mktemp -d --tmpdir postgrest/${name}-XXX)" # we keep the tmpdir when an error occurs for debugging trap 'echo Temporary directory kept at: $tmpdir' ERR diff --git a/nix/tools/withTools.nix b/nix/tools/withTools.nix index ea9085d37..c74ce3224 100644 --- a/nix/tools/withTools.nix +++ b/nix/tools/withTools.nix @@ -41,6 +41,8 @@ let } mkdir -p "$tmpdir"/{db,socket} + # remove data dir, even if we keep tmpdir - no need to upload it to artifacts + trap 'rm -rf $tmpdir/db' EXIT export PGDATA="$tmpdir/db" export PGHOST="$tmpdir/socket"