-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: Run cargo-semver-checks on PRs #1598
Merged
Merged
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
3c8f7d6
ci: Run cargo-semver-checks on PRs
aborgna-q 5bb9551
Test a non-breaking change
aborgna-q a0e3623
Don't run on merge queues
aborgna-q b5b88d9
Install capnproto...
aborgna-q d573bf2
test breaking change
aborgna-q 3e7a539
Undo breaking change
aborgna-q 638f3a5
Cleanup changes override vars
aborgna-q a38a975
Use hugrverse-actions @ `main`
aborgna-q File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,20 +25,34 @@ jobs: | |
# Check if changes were made to the relevant files. | ||
# Always returns true if running on the default branch, to ensure all changes are throughly checked. | ||
changes: | ||
name: Check for changes in Rust files | ||
name: Check for changes | ||
runs-on: ubuntu-latest | ||
# Required permissions | ||
permissions: | ||
pull-requests: read | ||
# Set job outputs to values from filter step | ||
# These outputs are always true when running after a merge to main, or if the PR has a `run-ci-checks` label. | ||
outputs: | ||
rust: ${{ github.ref_name == github.event.repository.default_branch || steps.filter.outputs.rust }} | ||
rust: ${{ steps.filter.outputs.rust == 'true' || steps.override.outputs.out == 'true' }} | ||
python: ${{ steps.filter.outputs.python == 'true' || steps.override.outputs.out == 'true' }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dorny/paths-filter@v3 | ||
id: filter | ||
with: | ||
filters: .github/change-filters.yml | ||
- uses: actions/checkout@v4 | ||
- name: Override label | ||
id: override | ||
run: | | ||
echo "Labels: ${{ github.event.pull_request.labels.*.name }}" | ||
echo "Label contains run-ci-checks: ${{ contains( github.event.pull_request.labels.*.name, 'run-ci-checks') }}" | ||
if [ "${{ github.event_name == 'pull_request' && contains( github.event.pull_request.labels.*.name, 'run-ci-checks') }}" == "true" ]; then | ||
echo "Overriding due to label 'run-ci-checks'" | ||
echo "out=true" >> $GITHUB_OUTPUT | ||
elif [ "${{ github.ref_name == github.event.repository.default_branch }}" == "true" ]; then | ||
echo "Overriding due to running on the default branch" | ||
echo "out=true" >> $GITHUB_OUTPUT | ||
fi | ||
- uses: dorny/paths-filter@v3 | ||
id: filter | ||
with: | ||
filters: .github/change-filters.yml | ||
|
||
check: | ||
needs: changes | ||
|
@@ -221,6 +235,15 @@ jobs: | |
flags: rust | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
rs-semver-checks: | ||
needs: changes | ||
if: ${{ needs.changes.outputs.rust == 'true' && github.event_name == 'pull_request' }} | ||
uses: CQCL/hugrverse-actions/.github/workflows/rs-semver-checks.yml@ab/semver-checks | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll change the target branch as soon as CQCL/hugrverse-actions#13 is merged |
||
with: | ||
apt-dependencies: capnproto | ||
secrets: | ||
GITHUB_PAT: ${{ secrets.HUGRBOT_PAT }} | ||
|
||
# This is a meta job to mark successful completion of the required checks, | ||
# even if they are skipped due to no changes in the relevant files. | ||
required-checks: | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems worth writing the result of
contains(
to a var