From d58fb8c6eee659e4a71c4d69bfb8539199b431bd Mon Sep 17 00:00:00 2001 From: Ophestra Date: Sat, 1 Feb 2025 21:05:18 +0900 Subject: [PATCH] workflows: fix nix store cache Prefix does not seem to match correctly, this appears to be a Gitea implementation bug. Signed-off-by: Ophestra --- .gitea/workflows/release.yml | 17 ++++++----------- .gitea/workflows/test.yml | 14 +++++++++----- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 40827d2..e032e64 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -9,17 +9,14 @@ jobs: release: name: Create release runs-on: ubuntu-latest + permissions: + actions: write steps: - name: Checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - - name: Setup go - uses: https://github.com/actions/setup-go@v5 - with: - go-version: '>=1.23.0' + uses: actions/checkout@v4 - name: Install Nix - uses: cachix/install-nix-action@08dcb3a5e62fa31e2da3d490afc4176ef55ecd72 # v30 + uses: cachix/install-nix-action@v30 with: # explicitly enable sandbox install_options: --daemon @@ -36,15 +33,13 @@ jobs: - name: Restore Nix store uses: nix-community/cache-nix-action@v5 with: - primary-key: nix-small-${{ runner.os }}-${{ hashFiles('**/*.nix') }} - restore-prefixes-first-match: nix-small-${{ runner.os }}- + primary-key: build-dist-${{ runner.os }}-${{ hashFiles('**/*.nix') }} + restore-prefixes-first-match: build-dist-${{ runner.os }}- - name: Build for release - id: build-test run: nix build --print-out-paths --print-build-logs .#dist - name: Release - id: use-go-action uses: https://gitea.com/actions/release-action@main with: files: |- diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml index aabca0f..cf35a21 100644 --- a/.gitea/workflows/test.yml +++ b/.gitea/workflows/test.yml @@ -8,12 +8,14 @@ jobs: test: name: Run NixOS test runs-on: ubuntu-latest + permissions: + actions: write steps: - name: Checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@v4 - name: Install Nix - uses: cachix/install-nix-action@08dcb3a5e62fa31e2da3d490afc4176ef55ecd72 # v30 + uses: cachix/install-nix-action@v30 with: # explicitly enable sandbox install_options: --daemon @@ -40,7 +42,7 @@ jobs: - name: Run tests run: | - nix --print-build-logs --experimental-features 'nix-command flakes' flake check --all-systems + nix --print-build-logs --experimental-features 'nix-command flakes' flake check nix build --out-link "result" --print-out-paths --print-build-logs .#checks.x86_64-linux.nixos-tests - name: Upload test output @@ -53,12 +55,14 @@ jobs: dist: name: Create distribution runs-on: ubuntu-latest + permissions: + actions: write steps: - name: Checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@v4 - name: Install Nix - uses: cachix/install-nix-action@08dcb3a5e62fa31e2da3d490afc4176ef55ecd72 # v30 + uses: cachix/install-nix-action@v30 with: # explicitly enable sandbox install_options: --daemon