Skip to content

Commit

Permalink
feat(ci): switch installers + enable magic cache
Browse files Browse the repository at this point in the history
  • Loading branch information
mrene committed Aug 6, 2024
1 parent 5058285 commit 35cc5ee
Showing 1 changed file with 12 additions and 24 deletions.
36 changes: 12 additions & 24 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
# rebuild everyday at 2:51
# TIP: Choose a random time here so not all repositories are build at once:
# https://www.random.org/clock-times/?num=1&earliest=01%3A00&latest=08%3A00&interval=5&format=html&rnd=new
- cron: '51 2 * * *'
- cron: '35 6 * * *'
jobs:
tests:
strategy:
Expand All @@ -22,42 +22,30 @@ jobs:
# https://github.com/nix-community/NUR/blob/master/repos.json
nurRepo:
- <YOUR_REPO_NAME>
# Set this to cache your build results in cachix for faster builds
# in CI and for everyone who uses your cache.
#
# Format: Your cachix cache host name without the ".cachix.org" suffix.
# Example: mycache (for mycache.cachix.org)
#
# For this to work, you also need to set the CACHIX_SIGNING_KEY or
# CACHIX_AUTH_TOKEN secret in your repository secrets settings in
# Github found at
# https://github.com/<your_githubname>/nur-packages/settings/secrets
cachixName:
- <YOUR_CACHIX_NAME>
nixPath:
- nixpkgs=https://github.com/NixOS/nixpkgs/archive/refs/heads/nixpkgs-unstable.tar.gz
- nixpkgs=https://github.com/NixOS/nixpkgs/archive/refs/heads/nixos-unstable.tar.gz
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install nix
uses: cachix/install-nix-action@V27
- uses: DeterminateSystems/nix-installer-action@main
with:
nix_path: "${{ matrix.nixPath }}"
extra_nix_config: |
extra-conf: |
experimental-features = nix-command flakes
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
nix-path = "${{ matrix.nixPath }}"
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Show nixpkgs version
run: nix-instantiate --eval -E '(import <nixpkgs> {}).lib.version'
- name: Setup cachix
uses: cachix/cachix-action@v15
# - name: Setup cachix
# uses: cachix/cachix-action@v15
# Don't replace <YOUR_CACHIX_NAME> here!
if: ${{ matrix.cachixName != '<YOUR_CACHIX_NAME>' }}
with:
name: ${{ matrix.cachixName }}
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
# if: ${{ matrix.cachixName != '<YOUR_CACHIX_NAME>' }}
# with:
# name: ${{ matrix.cachixName }}
# signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
# authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Check evaluation
run: |
nix-env -f . -qa \* --meta --xml \
Expand Down

0 comments on commit 35cc5ee

Please sign in to comment.