mirror of
https://github.com/DeterminateSystems/magic-nix-cache-action.git
synced 2024-12-25 06:22:02 +01:00
24 lines
462 B
Bash
24 lines
462 B
Bash
|
#!/bin/sh
|
||
|
|
||
|
set -e
|
||
|
set -ux
|
||
|
|
||
|
seed=$(date)
|
||
|
|
||
|
outpath=$(nix-build .github/workflows/cache-tester.nix --argstr seed "$seed")
|
||
|
nix copy --to 'http://127.0.0.1:37515' "$outpath"
|
||
|
rm ./result
|
||
|
nix store delete "$outpath"
|
||
|
if [ -f "$outpath" ]; then
|
||
|
echo "$outpath still exists? can't test"
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
rm -rf ~/.cache/nix
|
||
|
|
||
|
echo "-------"
|
||
|
echo "Trying to substitute the build again..."
|
||
|
echo "if it fails, the cache is broken."
|
||
|
|
||
|
nix-store --realize -vvvvvvvv "$outpath"
|