Compare commits
3 commits
a20e15c63a
...
b2582a051d
Author | SHA1 | Date | |
---|---|---|---|
b2582a051d | |||
e78bda179e | |||
1d7b20d51d |
2 changed files with 64 additions and 5 deletions
|
@ -1,7 +1,8 @@
|
||||||
name: build and cache random stuff
|
name: build and cache machines and homes
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
|
pull_request:
|
||||||
jobs:
|
jobs:
|
||||||
build-machines:
|
build-machines:
|
||||||
strategy:
|
strategy:
|
||||||
|
@ -53,9 +54,9 @@ jobs:
|
||||||
uses: nix-community/cache-nix-action@v5.1.0
|
uses: nix-community/cache-nix-action@v5.1.0
|
||||||
with:
|
with:
|
||||||
# restore and save a cache using this key
|
# restore and save a cache using this key
|
||||||
primary-key: nix-${{ runner.os }}-${{ matrix.machine }}-${{ hashFiles('flake.lock') }}
|
primary-key: nix-${{ runner.os }}-${{ matrix.machine }}-${{ hashFiles('**/*.nix', 'flake.lock') }}
|
||||||
# if there's no cache hit, restore a cache by this prefix
|
# if there's no cache hit, restore a cache by this prefix
|
||||||
restore-prefixes-first-match: nix-${{ runner.os }}-
|
restore-prefixes-first-match: nix-${{ runner.os }}-${{ matrix.machine }}-
|
||||||
# do purge caches
|
# do purge caches
|
||||||
purge: true
|
purge: true
|
||||||
# purge all versions of the cache
|
# purge all versions of the cache
|
||||||
|
@ -119,9 +120,9 @@ jobs:
|
||||||
uses: nix-community/cache-nix-action@v5.1.0
|
uses: nix-community/cache-nix-action@v5.1.0
|
||||||
with:
|
with:
|
||||||
# restore and save a cache using this key
|
# restore and save a cache using this key
|
||||||
primary-key: nix-${{ runner.os }}-${{ matrix.home }}-${{ hashFiles('flake.lock') }}
|
primary-key: nix-${{ runner.os }}-${{ matrix.home }}-${{ hashFiles('**/*.nix', 'flake.lock') }}
|
||||||
# if there's no cache hit, restore a cache by this prefix
|
# if there's no cache hit, restore a cache by this prefix
|
||||||
restore-prefixes-first-match: nix-${{ runner.os }}-
|
restore-prefixes-first-match: nix-${{ runner.os }}-${{ matrix.home }}-
|
||||||
# do purge caches
|
# do purge caches
|
||||||
purge: true
|
purge: true
|
||||||
# purge all versions of the cache
|
# purge all versions of the cache
|
58
.github/workflows/build-packages.yml
vendored
Normal file
58
.github/workflows/build-packages.yml
vendored
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
name: build and cache packages
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
jobs:
|
||||||
|
build-packages:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
package:
|
||||||
|
- github:cything/nixpkgs/928e0c6874ab3e759305e93f806a4cf559645677#alvr
|
||||||
|
os:
|
||||||
|
- ubuntu-latest
|
||||||
|
- macos-latest
|
||||||
|
- ubuntu-24.04-arm
|
||||||
|
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
continue-on-error: true
|
||||||
|
steps:
|
||||||
|
- name: Install Nix
|
||||||
|
uses: cachix/install-nix-action@v30
|
||||||
|
|
||||||
|
- name: Sync repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
|
- uses: cachix/cachix-action@v14
|
||||||
|
with:
|
||||||
|
name: cything
|
||||||
|
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
||||||
|
useDaemon: false
|
||||||
|
installCommand: nix profile install nixpkgs#cachix
|
||||||
|
|
||||||
|
- name: Setup Attic cache
|
||||||
|
uses: ryanccn/attic-action@v0
|
||||||
|
with:
|
||||||
|
endpoint: ${{ vars.ATTIC_ENDPOINT }}
|
||||||
|
cache: ${{ vars.ATTIC_CACHE }}
|
||||||
|
token: ${{ secrets.ATTIC_TOKEN }}
|
||||||
|
|
||||||
|
- name: Restore and cache Nix store
|
||||||
|
uses: nix-community/cache-nix-action@v5.1.0
|
||||||
|
with:
|
||||||
|
# restore and save a cache using this key
|
||||||
|
primary-key: nix-${{ runner.os }}-${{ matrix.package }}-${{ hashFiles('**/*.nix', 'flake.lock') }}
|
||||||
|
# if there's no cache hit, restore a cache by this prefix
|
||||||
|
restore-prefixes-first-match: nix-${{ runner.os }}-${{ matrix.package }}-
|
||||||
|
# do purge caches
|
||||||
|
purge: true
|
||||||
|
# purge all versions of the cache
|
||||||
|
purge-prefixes: nix-${{ runner.os }}-
|
||||||
|
# created more than this number of seconds ago relative to the start of the `Post Restore` phase
|
||||||
|
purge-last-accessed: 86400
|
||||||
|
# except the version with the `primary-key`, if it exists
|
||||||
|
purge-primary-key: never
|
||||||
|
# always save the cache
|
||||||
|
save-always: true
|
||||||
|
|
||||||
|
- run: nix build -L ${{ matrix.package }}
|
Loading…
Add table
Reference in a new issue