Verifies the source files of a Rust crate.
steps:
- uses: actions/checkout@v4
- uses: giancosta86/aurora-github/actions/verify-rust-crate@v10Please, note: this action is automatically run by verify-rust-wasm.
-
Run check-project-license to verify the LICENSE file.
-
Run enforce-branch-version, forwarding the
enforce-branch-versioninput to itsmodeinput. -
Display the version info for the main components of the Rust toolchain - verifying the existence of
rust-toolchain.toml. -
Check the style of the Rust source files - via
cargo fmt. -
Perform lint checks via
cargo clippy, enabling all features and targets. All warnings are considered errors. This step can be skipped. -
Extract each code snippet from
README.md- if the file exists - as a standalone test file in thetestsdirectory, via extract-rust-snippets. -
Run
cargo testwith all the project features disabled. -
Run
cargo testwith all the project features enabled. -
Generate the documentation, with all the project features enabled. All warnings are considered errors. This step can be skipped.
-
Find critical TODOs in the source code - which crash the workflow by default.
rust-toolchain.tomlmust be present inproject-directory- as described in check-rust-versions
| Name | Type | Description | Default value |
|---|---|---|---|
run-clippy-checks |
boolean | Enable linting via Clippy | true |
check-rustdoc |
boolean | Build the documentation - with warnings as errors | true |
crash-on-critical-todos |
boolean | Crash the workflow if critical TODOs are found | true |
source-file-regex |
string | PCRE pattern describing the source files | view source |
enforce-branch-version |
inject,check,skip |
How the branch version should be enforced | inject |
project-directory |
string | The directory containing Cargo.toml |
. |