1.6 KiB
1.6 KiB
rust-build
Set up Rust toolchain, configure Cargo registry, cache dependencies, run optional checks, and build via the project's build.sh script.
Inputs
| Input | Required | Default | Description |
|---|---|---|---|
working-directory |
No | . |
Directory containing Cargo.toml and build.sh |
rust-version |
No | 1.95.0 |
Rust toolchain version |
cross-target |
No | x86_64-unknown-linux-musl |
Cross-compilation target triple |
build-mode |
No | release |
Build mode — release or debug |
run-checks |
No | "" |
Comma-separated checks to run before building — fmt, clippy, test |
jfrog-token |
No | "" |
JFrog token for the Artifactory Cargo registry |
Usage
PR check (checks + debug build)
- uses: https://schmalz-git.git.onstackit.cloud/schmalz/shared-actions/rust-build@rust-build-v1
with:
working-directory: backend-rs
build-mode: debug
run-checks: fmt,clippy,test
jfrog-token: ${{ secrets.JFROG_TOKEN }}
Release build
- uses: https://schmalz-git.git.onstackit.cloud/schmalz/shared-actions/rust-build@rust-build-v1
with:
working-directory: backend-rs
jfrog-token: ${{ secrets.JFROG_TOKEN }}
Notes
- Requires a
build.shinworking-directorythat accepts--target <triple>and optionally--release. The script is responsible for runningcargo buildand copying binaries totarget/deploy/. - Configures the Artifactory Cargo registry only if
jfrog-tokenis provided. - Third-party actions used internally are pinned to exact commit SHAs to prevent supply chain attacks.