Skip to content

ci: reduce PR check time from ~30 min to ~1 min#1073

Merged
cjpais merged 2 commits intocjpais:mainfrom
VirenMohindra:vm/ci-improvements
Mar 18, 2026
Merged

ci: reduce PR check time from ~30 min to ~1 min#1073
cjpais merged 2 commits intocjpais:mainfrom
VirenMohindra:vm/ci-improvements

Conversation

@VirenMohindra
Copy link
Copy Markdown
Contributor

@VirenMohindra VirenMohindra commented Mar 17, 2026

Before Submitting This PR

Human Written Description

every push to a PR triggers 5 workflows with no concurrency controls, no path filters, and no nix caching. a README change triggers rust tests + a 30 min nix build. rapid pushes trigger duplicate runs that pile up

this PR adds concurrency groups, path filters, merges redundant workflows, and adds nix store caching. for PRs that don't touch nix files (the majority), the critical path drops from ~30 min to ~23 sec

Related Issues/Discussions

general CI/CD performance, no specific issue filed

Testing

tested on this PR itself:

frontend-only change (src/):

check before after
lint 14s merged into code-quality
prettier 18s merged into code-quality
code-quality n/a 14s
playwright 23s 23s
rust test ~2 min skipped (path filter)
nix-check (quick) ~30 min ~1 min (flake eval only, full build skipped)
total ~30 min ~23 sec

nix change (flake.nix):

check before after
nix-build (cold cache) ~29 min ~30 min (same, cache populating)
nix-build (warm cache) ~20 min should improve slightly with magic-nix-cache

concurrency groups confirmed, stale nix run was cancelled when new push arrived

changes

  • merge lint + prettier into code-quality.yml: eliminates one runner startup + duplicate bun install
  • concurrency groups on all PR workflows: cancel-in-progress: true cancels stale runs
  • path filters: src/ triggers code-quality + playwright + nix quick checks, src-tauri/ triggers rust test + nix quick checks, nix packaging files trigger the full nix build
  • two-tier nix strategy: quick checks (bun.nix sync, flake eval) run on any source change; full nix build (~25 min) only runs when packaging files change (flake.nix, flake.lock, .nix/**, bun.lock, Cargo.toml, Cargo.lock)
  • nix store caching via DeterminateSystems/magic-nix-cache-action@v13
  • cache [email protected] on windows: avoids recompiling from source every release build
  • upgrade setup-bun v1 → v2 in all workflows
  • workflow_dispatch on all workflows: manual trigger escape hatch when path filters need bypassing

note on branch protection

this PR deletes lint.yml and prettier.yml, replacing them with code-quality.yml. if branch protection rules require the old check names ("lint", "prettier"), they'll need to be updated to require "code-quality" instead

follow-up recommendation

the nix build is still ~25 min with a cold cache. setting up a cachix binary cache (free for open source, requires a repo secret) would bring this down to ~5 min by caching compiled outputs. happy to set this up if you create a cachix account

AI Assistance

  • AI was used (please describe below)

If AI was used:

  • Tools used: claude code
  • How extensively: audited all 9 workflow files, researched gh actions best practices, implemented changes, tested on this PR and subsequent runs and checked logs

@VirenMohindra VirenMohindra changed the title ci: reduce PR check time from ~30 min to ~5 min ci: reduce PR check time from ~30 min to ~1 min Mar 17, 2026
@VirenMohindra VirenMohindra force-pushed the vm/ci-improvements branch 2 times, most recently from 3181068 to 0519a60 Compare March 17, 2026 05:52
Comment on lines +14 to +20
paths:
- "flake.nix"
- "flake.lock"
- ".nix/**"
- "bun.lock"
- "src-tauri/Cargo.toml"
- "src-tauri/Cargo.lock"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

quick note on path filters..

src/** and src-tauri/** only trigger the fast checks (bun.nix sync + flake eval). the expensive nix build step is gated behind a separate diff check that looks for nix packaging files (flake.nix, flake.lock, .nix/**, bun.lock, Cargo.toml, Cargo.lock). so a TS or rust only change won't kick off a 25 min build

@VirenMohindra VirenMohindra force-pushed the vm/ci-improvements branch 3 times, most recently from 43b95bf to ec56880 Compare March 17, 2026 06:23
- merge lint + prettier into single code-quality workflow
- add concurrency groups to cancel stale runs on rapid pushes
- add path filters so irrelevant changes skip checks
- make full nix build opt-in via "nix" label (eval-only by default)
- add nix store caching via magic-nix-cache-action
- cache trusted-signing-cli binary on windows builds
- upgrade setup-bun from v1 to v2
Copy link
Copy Markdown
Contributor

@xilec xilec left a comment

Choose a reason for hiding this comment

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

Nice improvements overall!

- add .github/workflows/** to path filters on code-quality and nix-check
  so CI runs when workflow files themselves change
- include tauri.conf.json and build.rs in nix full-build diff check since
  these can break nix sandbox builds independently of cargo builds
@cjpais
Copy link
Copy Markdown
Owner

cjpais commented Mar 18, 2026

@VirenMohindra @xilec is this good to go?!

@VirenMohindra
Copy link
Copy Markdown
Contributor Author

yessir @cjpais

@xilec
Copy link
Copy Markdown
Contributor

xilec commented Mar 18, 2026

LGTM

@cjpais cjpais merged commit e1a484f into cjpais:main Mar 18, 2026
2 checks passed
@VirenMohindra VirenMohindra deleted the vm/ci-improvements branch March 19, 2026 05:27
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.

3 participants