Skip to content

ci: add path filters to clippy and tests workflows - #715

Merged
lklimek merged 2 commits into
v1.0-devfrom
ci/path-filters-clippy-tests
Mar 10, 2026
Merged

ci: add path filters to clippy and tests workflows#715
lklimek merged 2 commits into
v1.0-devfrom
ci/path-filters-clippy-tests

Conversation

@lklimek

@lklimek lklimek commented Mar 10, 2026

Copy link
Copy Markdown
Contributor

Issue being fixed or feature implemented

CI workflows (clippy, tests) run on every push and PR regardless of what changed, wasting runner minutes on non-Rust changes.

What was done?

Added paths filters to both push and pull_request triggers in clippy.yml and tests.yml. Workflows now only trigger when:

  • **/*.rs — any Rust source file
  • **/Cargo.toml — any Cargo manifest
  • Cargo.lock — dependency lockfile
  • .github/workflows/<self>.yml — the workflow file itself

How has this been tested?

Verified YAML syntax. Non-functional CI change — no manual test scenarios needed.

Breaking Changes

None

Checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation if needed

🤖 Co-authored by Claudius the Magnificent AI Agent

Only trigger clippy and test workflows when Rust source files,
Cargo manifests, Cargo.lock, or the workflow file itself changes.
Avoids unnecessary CI runs on docs-only or config-only changes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Mar 10, 2026

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@lklimek has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 0 minutes and 51 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1a5ede3a-b542-401f-93f3-919d9fb8a4ac

📥 Commits

Reviewing files that changed from the base of the PR and between 838336b and 709b841.

📒 Files selected for processing (2)
  • .github/workflows/clippy.yml
  • .github/workflows/tests.yml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ci/path-filters-clippy-tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@lklimek
lklimek marked this pull request as ready for review March 10, 2026 14:46
@lklimek
lklimek requested a review from Copilot March 10, 2026 14:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 adds paths filters to the push and pull_request triggers in both clippy.yml and tests.yml CI workflows, so that these workflows only run when Rust-related files (*.rs, Cargo.toml, Cargo.lock, or the workflow file itself) are changed — avoiding unnecessary runner consumption on documentation, asset, or other non-Rust changes.

Changes:

  • clippy.yml: Added paths filters to push and pull_request triggers.
  • tests.yml: Added paths filters to push and pull_request triggers.

Reviewed changes

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

File Description
.github/workflows/clippy.yml Adds paths triggers for Rust-related files to avoid running the Clippy/format check on irrelevant changes
.github/workflows/tests.yml Adds paths triggers for Rust-related files to avoid running the test suite on irrelevant changes

Two categories of issues were found:

Missing path entries: Both rust-toolchain.toml (which pins the Rust toolchain version, currently 1.92) and .cargo/config.toml (which sets rustflags and linker config) are absent from the paths filters. Changes to either file would affect compilation/linting results without triggering the CI workflows. (Comments #1, #2, #3, #4)

Required status checks risk: If "Clippy" or "Tests" are configured as required status checks in GitHub branch protection rules, PRs that only touch non-Rust files will have these checks reported as skipped, not passed. GitHub does not treat a skipped check as satisfying a required status check, which would silently block merging for such PRs. (Comments #5, #6)


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

Comment on lines +15 to +19
paths:
- "**/*.rs"
- "**/Cargo.toml"
- "Cargo.lock"
- ".github/workflows/clippy.yml"

Copilot AI Mar 10, 2026

Copy link

Choose a reason for hiding this comment

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

The paths filters also omit .cargo/config.toml, which contains rustflags and linker configurations affecting how the code is compiled. A change to that file could affect clippy and test outcomes without triggering the workflows. Consider adding ".cargo/config.toml" to the paths list.

Copilot uses AI. Check for mistakes.
Comment on lines +8 to +19
paths:
- "**/*.rs"
- "**/Cargo.toml"
- "Cargo.lock"
- ".github/workflows/clippy.yml"
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- "**/*.rs"
- "**/Cargo.toml"
- "Cargo.lock"
- ".github/workflows/clippy.yml"

Copilot AI Mar 10, 2026

Copy link

Choose a reason for hiding this comment

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

If the "Tests" or "Clippy" workflows are configured as required status checks in the branch protection rules for main or v*-dev, adding paths filters will cause those checks to be skipped (not reported at all) when a PR only touches non-Rust files (e.g., docs, CI configs, assets). A skipped check does not satisfy a "required" check on GitHub, which would block merging such PRs.

The recommended mitigation is to add a lightweight "pass-through" job that runs when the path filter causes the workflow to be skipped, typically using a separate workflow triggered by workflow_run or by adding a fallback job with if: ${{ !needs.<job>.result }}. Alternatively, use a tool like dorny/paths-filter to conditionally skip individual jobs while keeping the workflow always triggered.

Suggested change
paths:
- "**/*.rs"
- "**/Cargo.toml"
- "Cargo.lock"
- ".github/workflows/clippy.yml"
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- "**/*.rs"
- "**/Cargo.toml"
- "Cargo.lock"
- ".github/workflows/clippy.yml"
pull_request:
types: [opened, synchronize, reopened, ready_for_review]

Copilot uses AI. Check for mistakes.
Comment on lines +8 to +19
paths:
- "**/*.rs"
- "**/Cargo.toml"
- "Cargo.lock"
- ".github/workflows/tests.yml"
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- "**/*.rs"
- "**/Cargo.toml"
- "Cargo.lock"
- ".github/workflows/tests.yml"

Copilot AI Mar 10, 2026

Copy link

Choose a reason for hiding this comment

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

If the "Tests" workflow is configured as a required status check in branch protection rules for main or v*-dev, adding paths filters will cause the check to be skipped (not reported) when a PR only touches non-Rust files. A skipped check does not satisfy a "required" check on GitHub, which would block merging such PRs.

The recommended mitigation is to add a lightweight pass-through job (e.g., always reporting success) for cases where the path filter causes the workflow to be skipped, or to use dorny/paths-filter to conditionally skip individual jobs while always triggering the workflow.

Copilot uses AI. Check for mistakes.
Comment on lines +8 to +12
paths:
- "**/*.rs"
- "**/Cargo.toml"
- "Cargo.lock"
- ".github/workflows/tests.yml"

Copilot AI Mar 10, 2026

Copy link

Choose a reason for hiding this comment

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

The paths filters for both workflows omit rust-toolchain.toml, which pins the Rust toolchain version used by CI. A change to that file (e.g., bumping the toolchain version) would affect compilation and lint/test results but would not trigger these workflows. Consider adding "rust-toolchain.toml" to the paths list in both tests.yml and clippy.yml.

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/clippy.yml
Comment thread .github/workflows/tests.yml
Rustflags and linker config changes can affect clippy and test outcomes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@lklimek
lklimek enabled auto-merge (squash) March 10, 2026 14:54
@lklimek
lklimek merged commit 98d5e8a into v1.0-dev Mar 10, 2026
5 checks passed
@lklimek
lklimek deleted the ci/path-filters-clippy-tests branch March 10, 2026 15:01
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