Skip to content

Add reusable build/test, coverage, and miri workflows#18

Merged
theswiftfox merged 1 commit intoeclipse-opensovd:mainfrom
bburda42dot:feat/reusable-workflows
Mar 20, 2026
Merged

Add reusable build/test, coverage, and miri workflows#18
theswiftfox merged 1 commit intoeclipse-opensovd:mainfrom
bburda42dot:feat/reusable-workflows

Conversation

@bburda42dot
Copy link
Contributor

Summary

Add workflow_call-based reusable workflows for Rust projects:

  • build-and-test.yml - Cargo build + test with optional Bazel support, configurable --locked, toolchain version, and test args
  • coverage.yml - cargo-llvm-cov with configurable threshold enforcement, crate exclusion, filename ignore regex, and LCOV artifact upload
  • miri.yml - Miri undefined behavior checks with configurable nightly version, crate exclusion, and MIRIFLAGS

This allows all OpenSOVD Rust repos to share CI infrastructure instead of rolling custom pipelines. Follows the same pattern as the existing rust-lint-and-format-action and pre-commit-action.

First consumer: fault-lib PR #5.

Checklist

  • I have tested my changes locally
  • I have added or updated documentation
  • I have linked related issues or discussions
  • I have added or updated tests

Related

Notes for Reviewers

  • All workflow inputs are documented via description fields
  • Permissions follow least-privilege (contents: read)
  • Uses established actions: actions-rust-lang/setup-rust-toolchain, Swatinem/rust-cache, taiki-e/install-action, dtolnay/rust-toolchain

Copy link
Contributor

@alexmohr alexmohr left a comment

Choose a reason for hiding this comment

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

Thank you! That is very cool. Just some nitpicks and questions from my end :)

alexmohr
alexmohr previously approved these changes Mar 10, 2026
Copy link
Contributor

@alexmohr alexmohr left a comment

Choose a reason for hiding this comment

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

lgtm, thank you!

@alexmohr
Copy link
Contributor

@bburda42dot before merging, it would be great to squash the commits. I prefer that to be done by the commit author themselfs instead of doing it via the github ui 🙈

Add workflow_call-based reusable workflows for Rust projects:
- build-and-test.yml: Cargo build + test with optional Bazel support,
  configurable --locked, toolchain version, and test args
- coverage.yml: cargo-llvm-cov with configurable threshold enforcement,
  crate exclusion, filename ignore regex, and LCOV artifact upload
- miri.yml: Miri undefined behavior checks with configurable nightly
  version, crate exclusion, and MIRIFLAGS

Also migrate rust-lint-and-format-action from dtolnay/rust-toolchain +
separate Swatinem/rust-cache to actions-rust-lang/setup-rust-toolchain
which bundles both (with rustflags: "" to preserve existing behavior).

Replace fragile grep/awk coverage parsing with cargo llvm-cov --json
and jq for structured, version-resilient extraction.
@bburda42dot bburda42dot force-pushed the feat/reusable-workflows branch from 776b27d to 4026d96 Compare March 16, 2026 12:02
@bburda42dot
Copy link
Contributor Author

@alexmohr done!

@theswiftfox theswiftfox merged commit fef5cc7 into eclipse-opensovd:main Mar 20, 2026
2 checks passed
@theswiftfox
Copy link
Contributor

Merging this :)

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