test s3 cache

This commit is contained in:
cy 2025-03-27 14:42:22 -04:00
parent aea2a217c2
commit 56aaf9eabc
Signed by: cy
SSH key fingerprint: SHA256:o/geVWV4om1QhUSkKvDQeW/eAihwnjyXkqMwrVdbuts

View file

@ -7,12 +7,12 @@ env:
ATTIC_TOKEN: ${{ secrets.ATTIC_TOKEN }}
NIX_CONFIG: |
show-trace = true
extra-substituters = https://cdn.cy7.sh/main
extra-trusted-public-keys = main:Ku31HoEWcBtfggge2VGj+QTkVrQuIwRIMGyfV/5VQP0=
experimental-features = nix-command flakes
accept-flake-config = true
system-features = nixos-test benchmark big-parallel kvm
TERM: ansi
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets. AWS_SECRET_ACCESS_KEY }}
jobs:
build-machines:
strategy:
@ -42,10 +42,6 @@ jobs:
uses: actions/checkout@v4
with:
persist-credentials: false
- name: setup attic
run: |
nix profile install github:zhaofengli/attic
attic login cy7 https://cache.cy7.sh "$ATTIC_TOKEN"
- name: build
run: |
package=".#nixosConfigurations."${{ matrix.machine }}".config.system.build.toplevel"
@ -53,10 +49,7 @@ jobs:
- name: cache
if: always()
run: |
package=".#nixosConfigurations."${{ matrix.machine }}".config.system.build.toplevel"
derivation="$(nix path-info --derivation "$package")"
cache="$(nix-store --query --requisites --include-outputs "$derivation")"
xargs attic push main <<< "$cache"
nix copy ".#nixosConfigurations."${{ matrix.machine }}".config.system.build.toplevel" --to "s3://nixcache?endpoint=s3.cy7.sh"
build-homes:
strategy:
fail-fast: false
@ -86,10 +79,6 @@ jobs:
uses: actions/checkout@v4
with:
persist-credentials: false
- name: setup attic
run: |
nix profile install github:zhaofengli/attic
attic login cy7 https://cache.cy7.sh "$ATTIC_TOKEN"
- name: build
run: |
package=".#homeConfigurations."${{ matrix.home }}".activationPackage"
@ -97,7 +86,4 @@ jobs:
- name: cache
if: always()
run: |
package=".#homeConfigurations."${{ matrix.home }}".activationPackage"
derivation="$(nix path-info --derivation "$package")"
cache="$(nix-store --query --requisites --include-outputs "$derivation")"
xargs attic push main <<< "$cache"
nix copy ".#homeConfigurations."${{ matrix.home }}".activationPackage" --to "s3://nixcache?endpoint=s3.cy7.sh"