mirror of
https://github.com/DeterminateSystems/magic-nix-cache-action.git
synced 2024-12-23 13:32:03 +01:00
21c3863b07
Co-authored-by: Zhaofeng Li <hello@zhaofeng.li>
23 lines
462 B
Bash
Executable file
23 lines
462 B
Bash
Executable file
#!/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"
|