A reusable GitHub Actions workflow for building, testing, and publishing Rust packages.
Build and test Rust packages
Cache dependencies for faster builds
Publish packages to crates.io
Upload build artifacts
name : Rust CI
on : [pull_request]
jobs :
build-and-test :
uses : iExecBlockchainComputing/github-actions-workflows/.github/workflows/rust-build.yml@main
with :
rust-version : ' stable'
build-target : ' release'
enable-cache : true
upload-artifact : true
artifact-name : ' my-rust-app'
artifact-path : ' target/release/my-app'
Name
Description
Default
Required
rust-version
Rust version to use
stable
No
build-target
Cargo profile to use for building (debug, release)
release
No
enable-cache
Enable caching of dependencies
true
No
publish-crates-io
Publish package to crates.io
false
No
upload-artifact
Upload build artifact
false
No
artifact-name
Name of the artifact to upload
-
Only if upload-artifact is true
artifact-path
Path to the artifact to upload
-
Only if upload-artifact is true
Name
Description
Required
CRATES_IO_TOKEN
Token for publishing to crates.io
Only if publish-crates-io is true
jobs :
build-and-test :
uses : iExecBlockchainComputing/github-actions-workflows/.github/workflows/rust-build.yml@main
Build, Test, and Upload Artifact
jobs :
build-and-test :
uses : iExecBlockchainComputing/github-actions-workflows/.github/workflows/rust-build.yml@main
with :
upload-artifact : true
artifact-name : ' my-rust-app'
artifact-path : ' target/release/my-app'
Build, Test, and Publish to crates.io
jobs :
build-and-publish :
uses : iExecBlockchainComputing/github-actions-workflows/.github/workflows/rust-build.yml@main
with :
publish-crates-io : true
secrets :
CRATES_IO_TOKEN : ${{ secrets.CRATES_IO_TOKEN }}