Skip to content

Conversation

@dkgoutham
Copy link
Contributor

Adds a new GitHub Actions workflow that uses cargo-semver-checks to automatically detect versioning violations in Rust crates. This helps prevent accidental breaking changes and ensures proper version bumping according to semver rules.

@dkgoutham dkgoutham requested a review from a team as a code owner June 27, 2025 10:29
@github-actions
Copy link

Coverage after merging add-semver-checks into main will be

64.71%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
mycrate/src
   lib.rs66.67%100%80%64.71%33–44

@dkgoutham
Copy link
Contributor Author

I have a few questions:

  1. Should I add the workspace-level semver configuration to Cargo.toml? Like currently, the template has workspace lints for clippy/rust, should semver-checks configuration follow the same pattern?
  2. Should we configure specific semver lint behaviors for the template? For example, do we want #[must_use] additions to be warnings instead of errors?
  3. Should we make it easy for template users to disable this workflow if they don't want it?

@github-actions
Copy link

Coverage after merging add-semver-checks into main will be

64.71%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
mycrate/src
   lib.rs66.67%100%80%64.71%33–44

@github-actions
Copy link

Coverage after merging add-semver-checks into main will be

64.71%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
mycrate/src
   lib.rs66.67%100%80%64.71%33–44

@github-actions
Copy link

Coverage after merging add-semver-checks into main will be

64.71%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
mycrate/src
   lib.rs66.67%100%80%64.71%33–44

@github-actions
Copy link

Coverage after merging add-semver-checks into main will be

64.71%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
template_crate/src
   lib.rs66.67%100%80%64.71%33–44

Signed-off-by: stavrosvl7 <[email protected]>
@github-actions
Copy link

Coverage after merging add-semver-checks into main will be

64.71%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
template_crate/src
   lib.rs66.67%100%80%64.71%33–44

@svlachakis
Copy link
Collaborator

svlachakis commented Jun 30, 2025

The way the semver-check workflow works:

Scenario 1: New Project

  • No version tags exist
  • Workflow runs but skips semver check
  • Prints helpful message about creating first tag

Scenario 2: Existing Project

  • Has tag v0.1.0
  • You modify Cargo.toml and create PR
  • Workflow compares current code against v1.0.0
  • Fails if you removed a public function (breaking change)
  • Passes if you only added new features (non-breaking)

Scenario 3: Release

  • You push tag v0.1.1
  • Workflow runs and compares v0.1.1 against v0.1.0
  • Validates that the version bump matches the changes

Signed-off-by: stavrosvl7 <[email protected]>
@github-actions
Copy link

Coverage after merging add-semver-checks into main will be

64.71%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
template_crate/src
   lib.rs66.67%100%80%64.71%33–44

Signed-off-by: stavrosvl7 <[email protected]>
@github-actions
Copy link

Coverage after merging add-semver-checks into main will be

64.71%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
template_crate/src
   lib.rs66.67%100%80%64.71%33–44

Copy link
Collaborator

@maksimryndin maksimryndin left a comment

Choose a reason for hiding this comment

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

Awesome work @svlachakis and @dkgoutham ! 👍 thanks a lot! Let's introduce small changes and merge

Signed-off-by: stavrosvl7 <[email protected]>
@github-actions
Copy link

Coverage after merging add-semver-checks into main will be

64.29%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
template_crate/src
   lib.rs66.67%100%80%64.29%33–36, 38–40, 42–44

@svlachakis svlachakis requested a review from maksimryndin July 11, 2025 12:11
Copy link
Collaborator

@maksimryndin maksimryndin left a comment

Choose a reason for hiding this comment

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

LGTM! 👍

@svlachakis svlachakis merged commit aa729d8 into main Jul 11, 2025
7 checks passed
@svlachakis svlachakis deleted the add-semver-checks branch July 11, 2025 12:21
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.

4 participants