workflows: use native nix runner
Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
parent
268a90f1a5
commit
f545e154f0
@ -8,9 +8,7 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
name: Create release
|
name: Create release
|
||||||
runs-on: ubuntu-latest
|
runs-on: nix
|
||||||
permissions:
|
|
||||||
actions: write
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@ -20,27 +18,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
go-version: '>=1.23.0'
|
go-version: '>=1.23.0'
|
||||||
|
|
||||||
- name: Install Nix
|
|
||||||
uses: cachix/install-nix-action@v30
|
|
||||||
with:
|
|
||||||
# explicitly enable sandbox
|
|
||||||
install_options: --daemon
|
|
||||||
extra_nix_config: |
|
|
||||||
sandbox = true
|
|
||||||
system-features = nixos-test benchmark big-parallel kvm
|
|
||||||
enable_kvm: true
|
|
||||||
|
|
||||||
- name: Ensure environment
|
|
||||||
run: >-
|
|
||||||
apt-get update && apt-get install -y sqlite3
|
|
||||||
if: ${{ runner.os == 'Linux' }}
|
|
||||||
|
|
||||||
- name: Restore Nix store
|
|
||||||
uses: nix-community/cache-nix-action@v5
|
|
||||||
with:
|
|
||||||
primary-key: build-dist-${{ runner.os }}-${{ hashFiles('**/*.nix') }}
|
|
||||||
restore-prefixes-first-match: build-dist-${{ runner.os }}-
|
|
||||||
|
|
||||||
- name: Build for release
|
- name: Build for release
|
||||||
run: nix build --print-out-paths --print-build-logs .#dist
|
run: nix build --print-out-paths --print-build-logs .#dist
|
||||||
|
|
||||||
|
@ -7,39 +7,11 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
name: Run NixOS test
|
name: Run NixOS test
|
||||||
runs-on: ubuntu-latest
|
runs-on: nix
|
||||||
permissions:
|
|
||||||
actions: write
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install Nix
|
|
||||||
uses: cachix/install-nix-action@v30
|
|
||||||
with:
|
|
||||||
# explicitly enable sandbox
|
|
||||||
install_options: --daemon
|
|
||||||
extra_nix_config: |
|
|
||||||
sandbox = true
|
|
||||||
system-features = nixos-test benchmark big-parallel kvm
|
|
||||||
enable_kvm: true
|
|
||||||
|
|
||||||
- name: Ensure environment
|
|
||||||
run: >-
|
|
||||||
apt-get update && apt-get install -y sqlite3
|
|
||||||
if: ${{ runner.os == 'Linux' }}
|
|
||||||
|
|
||||||
- name: Restore Nix store
|
|
||||||
uses: nix-community/cache-nix-action@v5
|
|
||||||
with:
|
|
||||||
primary-key: flake-check-${{ runner.os }}-${{ hashFiles('**/*.nix') }}
|
|
||||||
restore-prefixes-first-match: flake-check-${{ runner.os }}-
|
|
||||||
gc-max-store-size-linux: 1073741824
|
|
||||||
purge: true
|
|
||||||
purge-prefixes: flake-check-${{ runner.os }}-
|
|
||||||
purge-created: 60
|
|
||||||
purge-primary-key: never
|
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: |
|
run: |
|
||||||
nix --print-build-logs --experimental-features 'nix-command flakes' flake check
|
nix --print-build-logs --experimental-features 'nix-command flakes' flake check
|
||||||
@ -54,39 +26,11 @@ jobs:
|
|||||||
|
|
||||||
dist:
|
dist:
|
||||||
name: Create distribution
|
name: Create distribution
|
||||||
runs-on: ubuntu-latest
|
runs-on: nix
|
||||||
permissions:
|
|
||||||
actions: write
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install Nix
|
|
||||||
uses: cachix/install-nix-action@v30
|
|
||||||
with:
|
|
||||||
# explicitly enable sandbox
|
|
||||||
install_options: --daemon
|
|
||||||
extra_nix_config: |
|
|
||||||
sandbox = true
|
|
||||||
system-features = nixos-test benchmark big-parallel kvm
|
|
||||||
enable_kvm: true
|
|
||||||
|
|
||||||
- name: Ensure environment
|
|
||||||
run: >-
|
|
||||||
apt-get update && apt-get install -y sqlite3
|
|
||||||
if: ${{ runner.os == 'Linux' }}
|
|
||||||
|
|
||||||
- name: Restore Nix store
|
|
||||||
uses: nix-community/cache-nix-action@v5
|
|
||||||
with:
|
|
||||||
primary-key: build-dist-${{ runner.os }}-${{ hashFiles('**/*.nix') }}
|
|
||||||
restore-prefixes-first-match: build-dist-${{ runner.os }}-
|
|
||||||
gc-max-store-size-linux: 1073741824
|
|
||||||
purge: true
|
|
||||||
purge-prefixes: build-dist-${{ runner.os }}-
|
|
||||||
purge-created: 60
|
|
||||||
purge-primary-key: never
|
|
||||||
|
|
||||||
- name: Build for test
|
- name: Build for test
|
||||||
id: build-test
|
id: build-test
|
||||||
run: >-
|
run: >-
|
||||||
|
Loading…
Reference in New Issue
Block a user