From 3406e62a77c646fdd719ed582d4780c266740751 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Sat, 10 Feb 2024 12:35:56 +0100 Subject: [PATCH] ci: Remove nix actions cache and prepopulate job The nix actions cache currently leads to repeated "no space left on devices" errors for jobs in CI. The prepopulate job is useless without the nix actions cache, so it will go away at the same time. --- .github/actions/setup-nix/action.yaml | 11 +---------- .github/workflows/ci.yaml | 27 --------------------------- .github/workflows/loadtest.yaml | 2 -- 3 files changed, 1 insertion(+), 39 deletions(-) diff --git a/.github/actions/setup-nix/action.yaml b/.github/actions/setup-nix/action.yaml index ae62c8e39..8f6b91c64 100644 --- a/.github/actions/setup-nix/action.yaml +++ b/.github/actions/setup-nix/action.yaml @@ -7,9 +7,6 @@ inputs: description: Token to pass to cachix tools: description: Tools to install with nix-env -iA - cache-id: - description: Cache id to use for cache-nix-action - default: "default" runs: using: composite @@ -17,13 +14,7 @@ runs: - uses: nixbuild/nix-quick-install-action@v26 with: nix_version: '2.13.6' - - name: Restore and cache Nix store - uses: nix-community/cache-nix-action@v4.0.3 - with: - key: cache-nix-${{ runner.os }}-id-${{ inputs.cache-id }}-${{ hashFiles('nix/**/*.nix', '.github/actions/setup-nix/*') }} - restore-keys: | - cache-nix-${{ runner.os }}-common- - - uses: cachix/cachix-action@v13 + - uses: cachix/cachix-action@v14 with: name: postgrest authToken: ${{ inputs.authToken }} diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5c1e24a0a..a5c63b4cd 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -18,32 +18,15 @@ concurrency: cancel-in-progress: "${{ github.event_name == 'pull_request' }}" jobs: - Prepopulate-Nix-Cache-Linux: - name: Prepopulate Nix cache for Linux runners - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Setup Nix Environment - uses: ./.github/actions/setup-nix - with: - cache-id: common - - name: Put all tools to store to be cached afterwards - run: | - # shellcheck disable=SC2046 - nix-store -v --realize $( nix-instantiate default.nix ) - shell: bash - Lint-Style: name: Lint & check code style runs-on: ubuntu-latest - needs: [Prepopulate-Nix-Cache-Linux] steps: - uses: actions/checkout@v4 - name: Setup Nix Environment uses: ./.github/actions/setup-nix with: tools: style - cache-id: common - name: Run linter (check locally with `nix-shell --run postgrest-lint`) run: postgrest-lint - name: Run style check (auto-format with `nix-shell --run postgrest-style`) @@ -53,7 +36,6 @@ jobs: Test-Nix: name: Test (Nix) runs-on: ubuntu-latest - needs: [Prepopulate-Nix-Cache-Linux] defaults: run: # Hack for enabling color output, see: @@ -65,7 +47,6 @@ jobs: uses: ./.github/actions/setup-nix with: tools: tests - cache-id: common - name: Run coverage (IO tests and Spec tests against PostgreSQL 15) run: postgrest-coverage @@ -91,7 +72,6 @@ jobs: pgVersion: [9.6, 10, 11, 12, 13, 14, 15, 16] name: Test PG ${{ matrix.pgVersion }} (Nix) runs-on: ubuntu-latest - needs: [Prepopulate-Nix-Cache-Linux] defaults: run: # Hack for enabling color output, see: @@ -103,9 +83,6 @@ jobs: uses: ./.github/actions/setup-nix with: tools: tests withTools - # It seems like they are installing the same set of derivations, so we can assign them the same cache id. - # This would decrease the amount of caches dowloaded on merge cache step and will prevent disk space issues. - cache-id: common - name: Run spec tests if: always() @@ -119,14 +96,12 @@ jobs: Test-Memory-Nix: name: Test memory (Nix) runs-on: ubuntu-latest - needs: [Prepopulate-Nix-Cache-Linux] steps: - uses: actions/checkout@v4 - name: Setup Nix Environment uses: ./.github/actions/setup-nix with: tools: memory - cache-id: common - name: Run memory tests run: postgrest-test-memory @@ -134,14 +109,12 @@ jobs: Build-Static-Nix: name: Build Linux static (Nix) runs-on: ubuntu-latest - needs: [Prepopulate-Nix-Cache-Linux] steps: - uses: actions/checkout@v4 - name: Setup Nix Environment uses: ./.github/actions/setup-nix with: tools: tests - cache-id: common - name: Build static executable run: nix-build -A postgrestStatic diff --git a/.github/workflows/loadtest.yaml b/.github/workflows/loadtest.yaml index 70517dddd..46cf085b7 100644 --- a/.github/workflows/loadtest.yaml +++ b/.github/workflows/loadtest.yaml @@ -26,7 +26,6 @@ jobs: uses: ./.github/actions/setup-nix with: tools: loadtest - cache-id: test-loadtest - uses: WyriHaximus/github-action-get-previous-tag@04e8485ecb6487243907e330d522ff60f02283ce # v1.4.0 id: get-latest-tag with: @@ -58,7 +57,6 @@ jobs: uses: ./.github/actions/setup-nix with: tools: loadtest - cache-id: test-loadtest - name: Run loadtest run: | postgrest-loadtest-against ${{ steps.get-latest-tag.outputs.tag }}