Verifies the source files of a Rust crate.
The action can be placed right after checking out the source code:
steps:
- uses: actions/checkout@v4
- uses: giancosta86/aurora-github/actions/verify-rust-crate@v6
Please, note: this action is automatically run by verify-rust-wasm.
-
Optionally run check-artifact-version, to ensure that the artifact version in
Cargo.toml
matches the version detected from the name of the current Git branch. -
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 thetests
directory, via extract-rust-snippets. -
Run
cargo test
with all the project features disabled. -
Run
cargo test
with 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.toml
must be present inproject-directory
- as described in check-rust-versions -
The requirements for check-artifact-version, if
check-artifact-version
is enabled.
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 |
check-artifact-version |
boolean | Ensure the version in Cargo.toml matches the branch name | true |
project-directory |
string | The directory containing Cargo.toml |
. |