1.4 KiB
1.4 KiB
rust-build
Run Rust CI -- fmt, clippy, tests, optional cross-compilation.
Inputs
| Input | Required | Default | Description |
|---|---|---|---|
toolchain |
No | stable |
Rust toolchain |
features |
No | "" |
Cargo features to enable |
cross-target |
No | "" |
Cross-compilation target (installs cross when set) |
run-fmt |
No | true |
Run cargo fmt --check |
run-clippy |
No | true |
Run clippy with -D warnings |
run-tests |
No | true |
Run cargo test |
run-deny |
No | false |
Run cargo deny check |
run-semver-checks |
No | false |
Run cargo semver-checks |
sccache-enabled |
No | true |
Enable sccache (requires sccache_ci_setup.sh in working directory) |
working-directory |
No | . |
Working directory |
Usage
- uses: schmalz/shared-actions/.github/actions/rust-build@v1
with:
features: serde,tokio
run-deny: "true"
Cross-compilation
- uses: schmalz/shared-actions/.github/actions/rust-build@v1
with:
cross-target: aarch64-unknown-linux-gnu
run-fmt: "false"
Notes
- Cargo registry and
target/directory are cached based onCargo.lockhash. - When
cross-targetis set,crossis installed and used instead ofcargofor clippy, test, and build steps.cargo fmtalways usescargodirectly. - sccache integration requires a
sccache_ci_setup.shscript in the working directory.