Compare commits

...

2 commits

Author SHA1 Message Date
cy
c6999339da
workflow: use !cancelled() instead of always() 2025-03-29 13:23:24 -04:00
cy
1537fd6444
workflow: try yet another way to cache 2025-03-29 13:23:24 -04:00
2 changed files with 36 additions and 12 deletions

View file

@ -70,12 +70,20 @@ jobs:
nix build -L "$package"
- name: cache
if: always()
# https://stackoverflow.com/a/58859404
if: '!cancelled()'
run: |
package=".#nixosConfigurations."${{ matrix.machine }}".config.system.build.toplevel"
nix copy -j8 \
--to 's3://nixcache?endpoint=s3.cy7.sh&secret-key=/home/runner/cache-priv-key.pem' \
$(nix path-info --recursive --derivation "$package" |sed 's/\.drv$/.drv^*/')
derivations=()
while IFS=$'\n' read derivation; do
derivations+=("$derivation")
done < <(nix path-info --derivation "$package")
for derivation in "${derivations[@]}"; do
nix copy -j8 \
--to 's3://nixcache?endpoint=s3.cy7.sh&secret-key=/home/runner/cache-priv-key.pem' \
$(nix-store --query --requisites --include-outputs "$derivation")
done
build-homes:
strategy:
@ -129,9 +137,17 @@ jobs:
nix build -L "$package"
- name: cache
if: always()
# https://stackoverflow.com/a/58859404
if: '!cancelled()'
run: |
package=".#homeConfigurations."${{ matrix.home }}".activationPackage"
nix copy -j8 \
--to 's3://nixcache?endpoint=s3.cy7.sh&secret-key=/home/runner/cache-priv-key.pem' \
$(nix path-info --recursive --derivation "$package" |sed 's/\.drv$/.drv^*/')
derivations=()
while IFS=$'\n' read derivation; do
derivations+=("$derivation")
done < <(nix path-info --derivation "$package")
for derivation in "${derivations[@]}"; do
nix copy -j8 \
--to 's3://nixcache?endpoint=s3.cy7.sh&secret-key=/home/runner/cache-priv-key.pem' \
$(nix-store --query --requisites --include-outputs "$derivation")
done

View file

@ -59,11 +59,19 @@ jobs:
- run: nix build -L ${{ matrix.package }}
- name: cache result
if: always()
# https://stackoverflow.com/a/58859404
if: '!cancelled()'
run: |
nix copy -j8 \
--to 's3://nixcache?endpoint=s3.cy7.sh&secret-key=/home/runner/cache-priv-key.pem' \
$(nix path-info --recursive --derivation "${{ matrix.package }}" |sed 's/\.drv$/.drv^*/')
derivations=()
while IFS=$'\n' read derivation; do
derivations+=("$derivation")
done < <(nix path-info --derivation "${{ matrix.package }}")
for derivation in "${derivations[@]}"; do
nix copy -j8 \
--to 's3://nixcache?endpoint=s3.cy7.sh&secret-key=/home/runner/cache-priv-key.pem' \
$(nix-store --query --requisites --include-outputs "$derivation")
done
- name: prepare tarball to upload
run: nix run github:nixos/nixpkgs#gnutar hcvf result.tar result