Skip to content

Latest commit

 

History

History
67 lines (39 loc) · 3.12 KB

File metadata and controls

67 lines (39 loc) · 3.12 KB

verify-rust-crate

Verifies the source files of a Rust crate.

Example

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.

How it works

  1. 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.

  2. Display the version info for the main components of the Rust toolchain - verifying the existence of rust-toolchain.toml.

  3. Check the style of the Rust source files - via cargo fmt.

  4. Perform lint checks via cargo clippy, enabling all features and targets. All warnings are considered errors. This step can be skipped.

  5. Extract each code snippet from README.md - if the file exists - as a standalone test file in the tests directory, via extract-rust-snippets.

  6. Run cargo test with all the project features disabled.

  7. Run cargo test with all the project features enabled.

  8. Generate the documentation, with all the project features enabled. All warnings are considered errors. This step can be skipped.

  9. Find critical TODOs in the source code - which crash the workflow by default.

Requirements

Inputs 📥

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 .

Further references