From a26a2fd4849bfd497ddc367c7134946da6b95f98 Mon Sep 17 00:00:00 2001 From: seth Date: Sun, 3 Dec 2023 04:17:43 -0500 Subject: [PATCH] ci: add nix workflows Signed-off-by: seth --- .github/workflows/nix.yml | 44 ++++++++++++++++++++++++++++++ .github/workflows/update-flake.yml | 28 +++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 .github/workflows/nix.yml create mode 100644 .github/workflows/update-flake.yml diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml new file mode 100644 index 0000000..57ae224 --- /dev/null +++ b/.github/workflows/nix.yml @@ -0,0 +1,44 @@ +name: Nix + +on: + push: + branches: ['main'] + pull_request: + workflow_dispatch: + +jobs: + build: + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Nix + uses: DeterminateSystems/nix-installer-action@v8 + + - name: Setup Nix cache + uses: DeterminateSystems/magic-nix-cache-action@v2 + + - name: Build refraction + run: nix build -L --fallback + + check: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Nix + uses: DeterminateSystems/nix-installer-action@v8 + + - name: Setup Nix cache + uses: DeterminateSystems/magic-nix-cache-action@v2 + + - name: Run checks + run: nix flake check -L --show-trace diff --git a/.github/workflows/update-flake.yml b/.github/workflows/update-flake.yml new file mode 100644 index 0000000..014a603 --- /dev/null +++ b/.github/workflows/update-flake.yml @@ -0,0 +1,28 @@ +name: Update flake.lock + +on: + schedule: + # run every saturday + - cron: '0 0 * * 6' + workflow_dispatch: + +jobs: + update: + runs-on: ubuntu-latest + + permissions: + contents: write + pull-requests: write + + steps: + - uses: actions/checkout@v4 + + - name: Install Nix + uses: nixbuild/nix-quick-install-action@v26 + + - name: Update and create PR + uses: DeterminateSystems/update-flake-lock@v20 + with: + commit-msg: 'flake: update inputs' + pr-title: 'flake: update inputs' + token: ${{ github.token }}