Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 21 additions & 6 deletions .github/actions/setup-nix/action.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
name: 'Setup Nix'
description: 'Install Nix and configure cache'
inputs:
tools:
description: 'Space-separated list of nixpkgs packages to install (e.g., "nodejs_24 pnpm_10 oxlint")'
required: false
default: 'nodejs_24 pnpm_10'
skip-pnpm-install:
description: 'Skip pnpm install step (useful for jobs that do not need node dependencies)'
required: false
default: 'false'
runs:
using: 'composite'
steps:
Expand All @@ -8,11 +17,17 @@ runs:
with:
github_access_token: ${{ github.token }}

- name: Cache Nix store
uses: nix-community/cache-nix-action@b426b118b6dc86d6952988d396aa7c6b09776d08 # v7.0.0
with:
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', 'flake.lock', 'pnpm-lock.yaml') }}
- name: Install tools from nixpkgs
shell: bash
run: |
tools="${{ inputs.tools }}"
packages=""
for tool in $tools; do
packages="$packages nixpkgs#$tool"
done
nix profile install --inputs-from . $packages
Comment on lines +20 to +28
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the cache-nix-action without replacement may negatively impact CI performance. While the PR description shows performance improvements in the short term, subsequent CI runs will need to re-download and rebuild Nix packages every time since there's no caching mechanism. Consider adding nix-community/cache-nix-action or another caching strategy back to maintain performance benefits across multiple CI runs.

Copilot uses AI. Check for mistakes.

- name: Load Nix development environment
- name: Install pnpm dependencies
if: inputs.skip-pnpm-install != 'true'
shell: bash
run: nix develop --command true
run: pnpm install --frozen-lockfile
15 changes: 10 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@ jobs:

- name: Setup Nix
uses: ./.github/actions/setup-nix
with:
tools: gitleaks
skip-pnpm-install: 'true'

- name: Run Gitleaks
run: nix develop --command gitleaks detect --source . --config .gitleaks.toml
run: gitleaks detect --source . --config .gitleaks.toml

lint:
runs-on: ubuntu-latest
Expand All @@ -37,8 +40,10 @@ jobs:
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Setup Nix
uses: ./.github/actions/setup-nix
with:
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tools list is duplicating information already defined in flake.nix. If the list of linting tools changes in flake.nix, this must be manually updated as well. Consider whether there's a way to maintain a single source of truth, or add a comment referencing the flake.nix buildInputs to help maintainers keep these in sync.

Suggested change
with:
with:
# Keep this tools list in sync with flake.nix (e.g. buildInputs) to avoid drift.

Copilot uses AI. Check for mistakes.
tools: nodejs_24 pnpm_10 oxlint oxfmt similarity nixfmt tsgolint
- name: Run Lint
run: nix develop --command pnpm run lint
run: pnpm run lint

build-and-test:
runs-on: ubuntu-latest
Expand All @@ -50,10 +55,10 @@ jobs:
uses: ./.github/actions/setup-nix

- name: Run Build
run: nix develop --command pnpm run build
run: pnpm run build

- name: Run Tests
run: nix develop --command pnpm test
run: pnpm test

coverage:
runs-on: ubuntu-latest
Expand All @@ -64,7 +69,7 @@ jobs:
- name: Setup Nix
uses: ./.github/actions/setup-nix
- name: Run Tests with Coverage
run: nix develop --command pnpm run coverage
run: pnpm run coverage
- name: Create Coverage Badge
uses: jaywcjlove/coverage-badges-cli@4e8975aa2628e3329126e7eee36724d07ed86fda # v2.2.0
with:
Expand Down
Loading