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.
This commit is contained in:
Wolfgang Walther
2024-02-24 19:52:25 +01:00
parent 3e5e8a22e4
commit 3406e62a77
3 changed files with 1 additions and 39 deletions
+1 -10
View File
@@ -7,9 +7,6 @@ inputs:
description: Token to pass to cachix description: Token to pass to cachix
tools: tools:
description: Tools to install with nix-env -iA <tools> description: Tools to install with nix-env -iA <tools>
cache-id:
description: Cache id to use for cache-nix-action
default: "default"
runs: runs:
using: composite using: composite
@@ -17,13 +14,7 @@ runs:
- uses: nixbuild/nix-quick-install-action@v26 - uses: nixbuild/nix-quick-install-action@v26
with: with:
nix_version: '2.13.6' nix_version: '2.13.6'
- name: Restore and cache Nix store - uses: cachix/cachix-action@v14
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
with: with:
name: postgrest name: postgrest
authToken: ${{ inputs.authToken }} authToken: ${{ inputs.authToken }}
-27
View File
@@ -18,32 +18,15 @@ concurrency:
cancel-in-progress: "${{ github.event_name == 'pull_request' }}" cancel-in-progress: "${{ github.event_name == 'pull_request' }}"
jobs: 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: Lint-Style:
name: Lint & check code style name: Lint & check code style
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [Prepopulate-Nix-Cache-Linux]
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Setup Nix Environment - name: Setup Nix Environment
uses: ./.github/actions/setup-nix uses: ./.github/actions/setup-nix
with: with:
tools: style tools: style
cache-id: common
- name: Run linter (check locally with `nix-shell --run postgrest-lint`) - name: Run linter (check locally with `nix-shell --run postgrest-lint`)
run: postgrest-lint run: postgrest-lint
- name: Run style check (auto-format with `nix-shell --run postgrest-style`) - name: Run style check (auto-format with `nix-shell --run postgrest-style`)
@@ -53,7 +36,6 @@ jobs:
Test-Nix: Test-Nix:
name: Test (Nix) name: Test (Nix)
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [Prepopulate-Nix-Cache-Linux]
defaults: defaults:
run: run:
# Hack for enabling color output, see: # Hack for enabling color output, see:
@@ -65,7 +47,6 @@ jobs:
uses: ./.github/actions/setup-nix uses: ./.github/actions/setup-nix
with: with:
tools: tests tools: tests
cache-id: common
- name: Run coverage (IO tests and Spec tests against PostgreSQL 15) - name: Run coverage (IO tests and Spec tests against PostgreSQL 15)
run: postgrest-coverage run: postgrest-coverage
@@ -91,7 +72,6 @@ jobs:
pgVersion: [9.6, 10, 11, 12, 13, 14, 15, 16] pgVersion: [9.6, 10, 11, 12, 13, 14, 15, 16]
name: Test PG ${{ matrix.pgVersion }} (Nix) name: Test PG ${{ matrix.pgVersion }} (Nix)
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [Prepopulate-Nix-Cache-Linux]
defaults: defaults:
run: run:
# Hack for enabling color output, see: # Hack for enabling color output, see:
@@ -103,9 +83,6 @@ jobs:
uses: ./.github/actions/setup-nix uses: ./.github/actions/setup-nix
with: with:
tools: tests withTools 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 - name: Run spec tests
if: always() if: always()
@@ -119,14 +96,12 @@ jobs:
Test-Memory-Nix: Test-Memory-Nix:
name: Test memory (Nix) name: Test memory (Nix)
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [Prepopulate-Nix-Cache-Linux]
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Setup Nix Environment - name: Setup Nix Environment
uses: ./.github/actions/setup-nix uses: ./.github/actions/setup-nix
with: with:
tools: memory tools: memory
cache-id: common
- name: Run memory tests - name: Run memory tests
run: postgrest-test-memory run: postgrest-test-memory
@@ -134,14 +109,12 @@ jobs:
Build-Static-Nix: Build-Static-Nix:
name: Build Linux static (Nix) name: Build Linux static (Nix)
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [Prepopulate-Nix-Cache-Linux]
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Setup Nix Environment - name: Setup Nix Environment
uses: ./.github/actions/setup-nix uses: ./.github/actions/setup-nix
with: with:
tools: tests tools: tests
cache-id: common
- name: Build static executable - name: Build static executable
run: nix-build -A postgrestStatic run: nix-build -A postgrestStatic
-2
View File
@@ -26,7 +26,6 @@ jobs:
uses: ./.github/actions/setup-nix uses: ./.github/actions/setup-nix
with: with:
tools: loadtest tools: loadtest
cache-id: test-loadtest
- uses: WyriHaximus/github-action-get-previous-tag@04e8485ecb6487243907e330d522ff60f02283ce # v1.4.0 - uses: WyriHaximus/github-action-get-previous-tag@04e8485ecb6487243907e330d522ff60f02283ce # v1.4.0
id: get-latest-tag id: get-latest-tag
with: with:
@@ -58,7 +57,6 @@ jobs:
uses: ./.github/actions/setup-nix uses: ./.github/actions/setup-nix
with: with:
tools: loadtest tools: loadtest
cache-id: test-loadtest
- name: Run loadtest - name: Run loadtest
run: | run: |
postgrest-loadtest-against ${{ steps.get-latest-tag.outputs.tag }} postgrest-loadtest-against ${{ steps.get-latest-tag.outputs.tag }}