-
Notifications
You must be signed in to change notification settings - Fork 824
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
3008: Add check-public-api.yaml workflow r=epilys a=fschutt WIP PR: Adds a new CI check that uses `cargo public-api` to track changes in the API between `master` and the last deployed version on crates.io. Fixes #2984 # Review - [x] Add a short description of the change to the CHANGELOG.md file Co-authored-by: Felix Schütt <[email protected]>
- Loading branch information
Showing
2 changed files
with
48 additions
and
0 deletions.
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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Check public API | ||
|
||
env: | ||
RUST_BACKTRACE: 1 | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
compareMasterWithVersion: | ||
required: false | ||
description: 'Version to compare with (i.e. "1.0.2")' | ||
jobs: | ||
setup: | ||
name: Set up | ||
runs-on: ubuntu-latest | ||
outputs: | ||
VERSION: ${{ steps.setup.outputs.VERSION }} | ||
SHOULD_CHECK_API: ${{ steps.setup.outputs.SHOULD_CHECK_API }} | ||
steps: | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install latest nightly | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: nightly | ||
profile: minimal | ||
override: true | ||
|
||
- name: Generate API change report | ||
shell: bash | ||
run: | | ||
cargo install cargo-public-api | ||
CARGO_LATEST_VERSION = git tag --list | tail -n 1 | ||
LATEST_VERSION=${INPUT_COMPAREMASTERWITHVERSION:=$CARGO_LATEST_VERSION} | ||
cargo public-api --manifest-path=lib/api/Cargo.toml --diff-git-checkouts $LATEST_VERSION master > diff.txt | ||
- name: Archive change report | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: api-diff-report | ||
path: | | ||
diff.txt | ||
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