ci: Add setup-nix action to reuse nix-related code
This commit is contained in:
committed by
Wolfgang Walther
parent
88283801cb
commit
f333305491
@@ -0,0 +1,21 @@
|
|||||||
|
name: Setup Nix
|
||||||
|
|
||||||
|
description: Installs nix, sets up cachix and installs a subset of tooling.
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
authToken:
|
||||||
|
description: Token to pass to cachix
|
||||||
|
tools:
|
||||||
|
description: Tools to install with nix-env -iA <tools>
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
steps:
|
||||||
|
- uses: cachix/install-nix-action@v13
|
||||||
|
- uses: cachix/cachix-action@v10
|
||||||
|
with:
|
||||||
|
name: postgrest
|
||||||
|
authToken: ${{ inputs.authToken }}
|
||||||
|
- if: ${{ inputs.tools }}
|
||||||
|
run: nix-env -f default.nix -iA ${{ inputs.tools }}
|
||||||
|
shell: bash
|
||||||
+16
-19
@@ -16,9 +16,10 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: cachix/install-nix-action@v13
|
- name: Setup Nix Environment
|
||||||
- name: Install linting and styling scripts
|
uses: ./.github/actions/setup-nix
|
||||||
run: nix-env -f default.nix -iA style
|
with:
|
||||||
|
tools: style
|
||||||
- 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`)
|
||||||
@@ -34,12 +35,10 @@ jobs:
|
|||||||
shell: script -qec "bash --noprofile --norc -eo pipefail {0}"
|
shell: script -qec "bash --noprofile --norc -eo pipefail {0}"
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: cachix/install-nix-action@v13
|
- name: Setup Nix Environment
|
||||||
- uses: cachix/cachix-action@v10
|
uses: ./.github/actions/setup-nix
|
||||||
with:
|
with:
|
||||||
name: postgrest
|
tools: tests withTools
|
||||||
- name: Install testing scripts
|
|
||||||
run: nix-env -f default.nix -iA tests withTools
|
|
||||||
|
|
||||||
- name: Run coverage (IO tests and Spec tests against PostgreSQL 14)
|
- name: Run coverage (IO tests and Spec tests against PostgreSQL 14)
|
||||||
run: postgrest-coverage
|
run: postgrest-coverage
|
||||||
@@ -84,12 +83,10 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: cachix/install-nix-action@v13
|
- name: Setup Nix Environment
|
||||||
- uses: cachix/cachix-action@v10
|
uses: ./.github/actions/setup-nix
|
||||||
with:
|
with:
|
||||||
name: postgrest
|
tools: memory
|
||||||
- name: Install testing script
|
|
||||||
run: nix-env -f default.nix -iA memory
|
|
||||||
- name: Run memory tests
|
- name: Run memory tests
|
||||||
run: postgrest-test-memory
|
run: postgrest-test-memory
|
||||||
|
|
||||||
@@ -98,10 +95,9 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: cachix/install-nix-action@v13
|
- name: Setup Nix Environment
|
||||||
- uses: cachix/cachix-action@v10
|
uses: ./.github/actions/setup-nix
|
||||||
with:
|
with:
|
||||||
name: postgrest
|
|
||||||
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
||||||
|
|
||||||
- name: Build static executable
|
- name: Build static executable
|
||||||
@@ -350,9 +346,10 @@ jobs:
|
|||||||
ISPRERELEASE: ${{ needs.Prepare-Release.outputs.isprerelease }}
|
ISPRERELEASE: ${{ needs.Prepare-Release.outputs.isprerelease }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: cachix/install-nix-action@v13
|
- name: Setup Nix Environment
|
||||||
- name: Install release scripts
|
uses: ./.github/actions/setup-nix
|
||||||
run: nix-env -f default.nix -iA release
|
with:
|
||||||
|
tools: release
|
||||||
- name: Download Docker image
|
- name: Download Docker image
|
||||||
uses: actions/download-artifact@v2
|
uses: actions/download-artifact@v2
|
||||||
with:
|
with:
|
||||||
|
|||||||
Reference in New Issue
Block a user