From f545e154f0c6e838cee130c3d1fae47687e5fdc4 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Sat, 15 Feb 2025 20:49:28 +0900 Subject: [PATCH] workflows: use native nix runner Signed-off-by: Ophestra --- .gitea/workflows/release.yml | 25 +-------------- .gitea/workflows/test.yml | 60 ++---------------------------------- 2 files changed, 3 insertions(+), 82 deletions(-) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index c278d8c..c6c1dda 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -8,9 +8,7 @@ on: jobs: release: name: Create release - runs-on: ubuntu-latest - permissions: - actions: write + runs-on: nix steps: - name: Checkout uses: actions/checkout@v4 @@ -20,27 +18,6 @@ jobs: with: 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 run: nix build --print-out-paths --print-build-logs .#dist diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml index cf35a21..4ea5948 100644 --- a/.gitea/workflows/test.yml +++ b/.gitea/workflows/test.yml @@ -7,39 +7,11 @@ on: jobs: test: name: Run NixOS test - runs-on: ubuntu-latest - permissions: - actions: write + runs-on: nix steps: - name: Checkout 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 run: | nix --print-build-logs --experimental-features 'nix-command flakes' flake check @@ -54,39 +26,11 @@ jobs: dist: name: Create distribution - runs-on: ubuntu-latest - permissions: - actions: write + runs-on: nix steps: - name: Checkout 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 id: build-test run: >-