Skip to content

Conversation

@ryoppippi
Copy link
Member

@ryoppippi ryoppippi commented Jan 16, 2026

Summary

  • Replace nix develop --command with nix profile install --inputs-from . for faster CI setup
  • Add tools input to setup-nix action for per-job tool selection
  • Install only required tools per job (e.g., gitleaks job only installs gitleaks)

Performance improvement

Metric Before After
Total CI time ~2m10s ~43s
Setup Nix (gitleaks) ~27s ~15s
Setup Nix (lint) ~29s ~26s
Setup Nix (build-and-test) ~29s ~24s

Test plan

  • CI passes on this branch
  • All jobs (gitleaks, lint, build-and-test) complete successfully

Summary by cubic

Switch CI from nix develop to nix profile install with per-job tool selection for faster, leaner setup. Total CI time drops from ~2m10s to ~43s.

  • Refactors

    • Install tools via nix profile install --inputs-from . using new tools input; add skip-pnpm-install for non-Node jobs.
    • Remove cache-nix-action; rely on nixpkgs binary cache and flake.lock.
    • Run gitleaks/lint/build/test directly (no nix develop); gitleaks job installs only gitleaks.
  • Performance

    • Total CI: ~2m10s → ~43s
    • Setup Nix: gitleaks 27s → 15s; lint 29s → 26s; build-and-test 29s → 24s

Written for commit effd70b. Summary will update on new commits.

- Replace nix develop --command with direct command execution
- Add tools input to setup-nix action for per-job tool selection
- Install only required tools per job (e.g., gitleaks job only installs gitleaks)
- Remove cache-nix-action as nixpkgs binary cache handles caching
- This should reduce CI setup time by avoiding devShell evaluation
gitleaks job only needs gitleaks binary, not node dependencies
Use flake.lock pinned nixpkgs revision to benefit from evaluation caching
Copilot AI review requested due to automatic review settings January 16, 2026 20:50
@ryoppippi ryoppippi requested a review from a team as a code owner January 16, 2026 20:50
@ryoppippi ryoppippi merged commit 86bf01d into main Jan 16, 2026
23 checks passed
@ryoppippi ryoppippi deleted the chore/use-nix-profile-in-ci branch January 16, 2026 20:51
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR optimizes CI performance by replacing nix develop --command with nix profile install and implementing per-job tool selection. The setup-nix action now accepts a tools input to install only the packages needed for each job, and a skip-pnpm-install flag for jobs that don't need Node.js dependencies.

Changes:

  • Modified setup-nix action to accept tool lists and conditionally skip pnpm install
  • Updated all CI jobs to use direct commands instead of nix develop --command
  • Removed nix-community/cache-nix-action caching step

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
.github/workflows/ci.yaml Updated gitleaks, lint, build-and-test, and coverage jobs to specify required tools and run commands directly without nix develop wrapper
.github/actions/setup-nix/action.yaml Added tools and skip-pnpm-install inputs, replaced cache-nix-action with nix profile install approach, added conditional pnpm install step

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +20 to +28
- 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
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.
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.
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 2 files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants