From 3dda4826a41023f5aace369aa594f4d71e9f8a63 Mon Sep 17 00:00:00 2001 From: Mieszko Grodzicki Date: Mon, 24 Apr 2023 05:02:09 +0200 Subject: [PATCH] Polishing README (#43) * Remove repeated cargo publish * Headings and table of contents --- README.md | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index c99f4b1..d3b6c13 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,13 @@ Lint your crate API changes for semver violations. run: # your `cargo publish` code here ``` -# Input options +* [Input options](#input-options) +* [Example scenarios](#example-scenarios) + * [Use in workspaces with a single crate](#use-in-workspaces-with-a-single-crate) + * [Use in workspaces with more than one crate](#use-in-workspaces-with-more-than-one-crate) +* [Customizing baseline rustdoc caching strategy](#customizing-baseline-rustdoc-caching-strategy) + +## Input options Every argument is optional. @@ -24,7 +30,9 @@ Every argument is optional. | `prefix-key` | Additional prefix of the cache key, can be set to start a new cache manually. | | | `github-token` | The `GITHUB_TOKEN` secret used to download precompiled binaries from GitHub API. If not specified, the [automatic GitHub token](https://docs.github.com/en/actions/security-guides/automatic-token-authentication) provided to the workflow will be used. The token may be alternatively passed in an environment variable `GITHUB_TOKEN`. | `${{ github.token }}` | -# Use in workspaces with a single crate +## Example scenarios + +### Use in workspaces with a single crate The action will work out-of-the-box if it is run inside the package root directory. When the package location is different, you have to specify the path to its `Cargo.toml` file: ```yaml @@ -32,11 +40,9 @@ The action will work out-of-the-box if it is run inside the package root directo uses: obi1kenobi/cargo-semver-checks-action@v2 with: manifest-path: semver/my-crate/Cargo.toml # or just semver/my-crate/ -- name: Publish my-crate to crates.io - run: # your `cargo publish` code here ``` -# Use in workspaces with more than one crate +### Use in workspaces with more than one crate By default, if workspace contains multiple crates, all of them are checked for semver violations. You can specify one or more crates to be checked instead using `package`, `exclude` or `manifest-path`. @@ -46,8 +52,6 @@ For example, this will check `my-crate-api` and `my-crate-core`: uses: obi1kenobi/cargo-semver-checks-action@v2 with: package: my-crate-api, my-crate-core -- name: Publish my-crate to crates.io - run: # your `cargo publish` code here ``` And this will process all crates from the current workspace except `my-crate-tests`: ```yaml @@ -55,8 +59,6 @@ And this will process all crates from the current workspace except `my-crate-tes uses: obi1kenobi/cargo-semver-checks-action@v2 with: exclude: my-crate-tests -- name: Publish my-crate to crates.io - run: # your `cargo publish` code here ``` If the action is not run inside the workspace root directory, you again have to specify the path to its `Cargo.toml` file: @@ -65,8 +67,6 @@ If the action is not run inside the workspace root directory, you again have to uses: obi1kenobi/cargo-semver-checks-action@v2 with: manifest-path: semver/my-workspace/Cargo.toml # or just semver/my-workspace/ -- name: Publish my-workspace to crates.io - run: # your `cargo publish` code here ``` The two above might be also used together: @@ -76,11 +76,9 @@ The two above might be also used together: with: manifest-path: semver/my-workspace/Cargo.toml # or just semver/my-workspace/ package: my-crate -- name: Publish my-crate to crates.io - run: # your `cargo publish` code here ``` -# Customizing baseline rustdoc caching strategy +## Customizing baseline rustdoc caching strategy The action caches the baseline rustdoc for each package in the workspace. The keys used to distinguish the caches consist of four components: