From d0b264e216a1e80c16415af635c5b07b2d6606a0 Mon Sep 17 00:00:00 2001 From: Daniel Thwaites Date: Wed, 13 Mar 2024 10:34:57 +0000 Subject: [PATCH] ci: use Magic Nix Cache (#279) --- .github/workflows/build.yml | 22 ++++++++++++++++++---- .github/workflows/docs.yml | 11 +++++++++-- CONTRIBUTING.md | 1 + 3 files changed, 28 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4ed21c44..8fdafa59 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,10 +10,17 @@ jobs: steps: - name: Install Nix - uses: cachix/install-nix-action@v22 + uses: DeterminateSystems/nix-installer-action@main + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + extra-conf: | + extra-experimental-features = nix-command flakes + + - name: Set up cache + uses: DeterminateSystems/magic-nix-cache-action@main - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: List packages id: list-packages @@ -37,10 +44,17 @@ jobs: steps: - name: Install Nix - uses: cachix/install-nix-action@v22 + uses: DeterminateSystems/nix-installer-action@main + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + extra-conf: | + extra-experimental-features = nix-command flakes + + - name: Set up cache + uses: DeterminateSystems/magic-nix-cache-action@main - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Build ${{ matrix.build.key }} run: nix -L build .#${{ matrix.build.type }}.${{ matrix.build.arch }}.${{ matrix.build.key }} diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 078df154..0fe811b9 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -16,10 +16,17 @@ jobs: steps: - name: Install Nix - uses: cachix/install-nix-action@v22 + uses: DeterminateSystems/nix-installer-action@main + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + extra-conf: | + extra-experimental-features = nix-command flakes + + - name: Set up cache + uses: DeterminateSystems/magic-nix-cache-action@main - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Build docs run: nix -L build .#docs diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 693d0717..83db8280 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -15,6 +15,7 @@ Where the scope is one of: | Scope | Purpose | |----------------|------------------------------------------------------------------------| +| `ci` | Changes to GitHub Actions workflows. | | `doc` | Changes to the website, `README.md`, and so on. | | `stylix` | Changes in the `stylix` directory, `flake.nix`, and other global code. | | Name of target | Changes to code for a particular target. |