Skip to content

Speed up CI with concurrency groups and targeted CodeQL builds#240

Merged
dfed merged 3 commits into
mainfrom
dfed/codeql-prebuild-dependencies
Apr 10, 2026
Merged

Speed up CI with concurrency groups and targeted CodeQL builds#240
dfed merged 3 commits into
mainfrom
dfed/codeql-prebuild-dependencies

Conversation

@dfed
Copy link
Copy Markdown
Owner

@dfed dfed commented Apr 10, 2026

Summary

  • Add concurrency groups to both CI and CodeQL workflows so new pushes on a PR branch cancel in-progress runs
  • Main branch and scheduled runs are never cancelled — each gets a unique group via github.run_id
  • Build only SafeDI and SafeDITool targets in debug mode for CodeQL instead of a full release build of everything
  • Clean up redundant xcode-select call and stale comments in CodeQL workflow

Context

Investigated pre-building dependencies before CodeQL init to avoid tracing swift-syntax compilation. This doesn't work for Swift — CodeQL replaces the Swift compiler with a tracing wrapper, which invalidates SPM's entire build cache.

Instead, we reduce CodeQL build time by:

  1. Debug mode (SPM default) — skips release optimizations that CodeQL doesn't need
  2. Targeted builds — only SafeDI and SafeDITool, skipping test targets

Test plan

  • Verify CodeQL workflow completes successfully with targeted debug build
  • Compare Swift analysis job duration against the ~57 min baseline on main
  • Push twice in quick succession on a PR to confirm stale runs get cancelled

🤖 Generated with Claude Code

Build the project before CodeQL init so swift-syntax and other
third-party dependencies are cached. Then touch only our source
files and rebuild, so CodeQL only traces compilation of SafeDI code.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (1372465) to head (1ee60a6).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #240   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           41        41           
  Lines         5772      5772           
=========================================
  Hits          5772      5772           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Cancel in-progress PR runs when new commits are pushed to the same
branch. Main branch and scheduled runs are never cancelled since
each gets a unique concurrency group via github.run_id.

Also cleans up redundant xcode-select and stale comments in the
CodeQL workflow.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dfed dfed changed the title Pre-build dependencies before CodeQL tracing Add concurrency groups to CI and CodeQL workflows Apr 10, 2026
Use debug mode (SPM default) instead of release — CodeQL doesn't
need optimized binaries. Build only the two product targets instead
of everything, skipping test targets.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dfed dfed changed the title Add concurrency groups to CI and CodeQL workflows Speed up CI with concurrency groups and targeted CodeQL builds Apr 10, 2026
@dfed dfed marked this pull request as ready for review April 10, 2026 18:28
@dfed dfed merged commit 1f0bf01 into main Apr 10, 2026
17 checks passed
@dfed dfed deleted the dfed/codeql-prebuild-dependencies branch April 10, 2026 18:38
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.

1 participant