From 7a621d4731c1b9b2eb7ced8ec92490887be4c2f8 Mon Sep 17 00:00:00 2001 From: HendrikRauh <114620133+HendrikRauh@users.noreply.github.com> Date: Fri, 6 Mar 2026 12:26:09 +0100 Subject: [PATCH 1/4] add(workflow): create check workflow for linting and building --- .github/workflows/check.yml | 45 +++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/check.yml diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..6f316af --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,45 @@ +name: check + +"on": + workflow_dispatch: {} + push: + branches: ["main"] + pull_request: + branches: ["**"] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v5 + + - name: Install Nix + uses: cachix/install-nix-action@v31 + with: + extra_nix_config: | + experimental-features = nix-command flakes + + - name: Run pre-commit from flake devShell + run: | + # use the flake devShell defined in ./flake.nix (x86_64 runner) + nix develop --command pre-commit run --all-files + shell: bash + + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v5 + + - name: Install Nix + uses: cachix/install-nix-action@v31 + with: + extra_nix_config: | + experimental-features = nix-command flakes + + - name: Run build from flake devShell + run: | + # use the flake devShell defined in ./flake.nix (x86_64 runner) + nix develop --command invoke build + shell: bash From c362172cdbff463c01dc0f7e0feb7c15b3762f56 Mon Sep 17 00:00:00 2001 From: HendrikRauh <114620133+HendrikRauh@users.noreply.github.com> Date: Fri, 6 Mar 2026 14:45:06 +0100 Subject: [PATCH 2/4] add(action): create composite action to install Nix with flakes enabled --- .github/actions/install-nix/action.yml | 19 +++++++++++++++++++ .github/workflows/check.yml | 20 ++++---------------- 2 files changed, 23 insertions(+), 16 deletions(-) create mode 100644 .github/actions/install-nix/action.yml diff --git a/.github/actions/install-nix/action.yml b/.github/actions/install-nix/action.yml new file mode 100644 index 0000000..60d3444 --- /dev/null +++ b/.github/actions/install-nix/action.yml @@ -0,0 +1,19 @@ +name: install-nix +description: Composite action to checkout the repo and install Nix with flakes enabled +runs: + using: composite + steps: + - name: Checkout + uses: actions/checkout@v5 + + - name: Install Nix + uses: cachix/install-nix-action@v31 + with: + extra_nix_config: | + experimental-features = nix-command flakes + + - name: Prewarm flake devShell + run: | + # use the flake devShell defined in ./flake.nix to fetch deps + nix develop --command true + shell: bash diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 6f316af..4f3f22e 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -11,14 +11,8 @@ jobs: lint: runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v5 - - - name: Install Nix - uses: cachix/install-nix-action@v31 - with: - extra_nix_config: | - experimental-features = nix-command flakes + - name: Setup checkout + Nix + uses: ./.github/actions/install-nix - name: Run pre-commit from flake devShell run: | @@ -29,14 +23,8 @@ jobs: build: runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v5 - - - name: Install Nix - uses: cachix/install-nix-action@v31 - with: - extra_nix_config: | - experimental-features = nix-command flakes + - name: Setup checkout + Nix + uses: ./.github/actions/install-nix - name: Run build from flake devShell run: | From 198c835c5030a3fd80084712542cfc191a556c77 Mon Sep 17 00:00:00 2001 From: HendrikRauh <114620133+HendrikRauh@users.noreply.github.com> Date: Fri, 6 Mar 2026 14:49:23 +0100 Subject: [PATCH 3/4] fix(workflow): checkout before local action and remove nested checkout Add top-level `actions/checkout` to jobs so local action files are available, and remove redundant checkout from `install-nix` composite action. Prewarm flake devShell remains in the action. --- .github/actions/install-nix/action.yml | 12 ++++++++++-- .github/workflows/check.yml | 6 ++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/actions/install-nix/action.yml b/.github/actions/install-nix/action.yml index 60d3444..f023cc4 100644 --- a/.github/actions/install-nix/action.yml +++ b/.github/actions/install-nix/action.yml @@ -3,8 +3,16 @@ description: Composite action to checkout the repo and install Nix with flakes e runs: using: composite steps: - - name: Checkout - uses: actions/checkout@v5 + - name: Install Nix + uses: cachix/install-nix-action@v31 + with: + extra_nix_config: | + experimental-features = nix-command flakes + - name: Prewarm flake devShell + run: | + # use the flake devShell defined in ./flake.nix to fetch deps + nix develop --command true + shell: bash - name: Install Nix uses: cachix/install-nix-action@v31 diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 4f3f22e..2cfcd9a 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -11,6 +11,9 @@ jobs: lint: runs-on: ubuntu-latest steps: + - name: Checkout + uses: actions/checkout@v5 + - name: Setup checkout + Nix uses: ./.github/actions/install-nix @@ -23,6 +26,9 @@ jobs: build: runs-on: ubuntu-latest steps: + - name: Checkout + uses: actions/checkout@v5 + - name: Setup checkout + Nix uses: ./.github/actions/install-nix From e576348974fce274381baec75f8556dbfb292f3d Mon Sep 17 00:00:00 2001 From: HendrikRauh <114620133+HendrikRauh@users.noreply.github.com> Date: Fri, 6 Mar 2026 15:07:46 +0100 Subject: [PATCH 4/4] refactor(action): update description and improve step names in install-nix action --- .github/actions/install-nix/action.yml | 21 +++++---------------- .github/workflows/check.yml | 12 ++++++------ 2 files changed, 11 insertions(+), 22 deletions(-) diff --git a/.github/actions/install-nix/action.yml b/.github/actions/install-nix/action.yml index f023cc4..778cf99 100644 --- a/.github/actions/install-nix/action.yml +++ b/.github/actions/install-nix/action.yml @@ -1,27 +1,16 @@ name: install-nix -description: Composite action to checkout the repo and install Nix with flakes enabled +description: Install Nix with flakes enabled and pre-warm the repository's flake devShell runs: using: composite steps: - - name: Install Nix + - name: Install Nix (with flakes) uses: cachix/install-nix-action@v31 with: extra_nix_config: | experimental-features = nix-command flakes - - name: Prewarm flake devShell + - name: Pre-warm flake devShell run: | - # use the flake devShell defined in ./flake.nix to fetch deps - nix develop --command true - shell: bash - - - name: Install Nix - uses: cachix/install-nix-action@v31 - with: - extra_nix_config: | - experimental-features = nix-command flakes - - - name: Prewarm flake devShell - run: | - # use the flake devShell defined in ./flake.nix to fetch deps + # Use the repository's `flake.nix` devShell to fetch dependencies. + # This speeds up later `nix develop` invocations in workflow steps. nix develop --command true shell: bash diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 2cfcd9a..5a86bd7 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -11,29 +11,29 @@ jobs: lint: runs-on: ubuntu-latest steps: - - name: Checkout + - name: Checkout repository uses: actions/checkout@v5 - - name: Setup checkout + Nix + - name: Install Nix and pre-warm flake devShell uses: ./.github/actions/install-nix - name: Run pre-commit from flake devShell run: | - # use the flake devShell defined in ./flake.nix (x86_64 runner) + # Use the flake devShell defined in ./flake.nix (x86_64 runner) nix develop --command pre-commit run --all-files shell: bash build: runs-on: ubuntu-latest steps: - - name: Checkout + - name: Checkout repository uses: actions/checkout@v5 - - name: Setup checkout + Nix + - name: Install Nix and pre-warm flake devShell uses: ./.github/actions/install-nix - name: Run build from flake devShell run: | - # use the flake devShell defined in ./flake.nix (x86_64 runner) + # Use the flake devShell defined in ./flake.nix (x86_64 runner) nix develop --command invoke build shell: bash