Rust GitHub Workflows is a library that allows developers to write GitHub Actions in Rust, empowering you to automate, manage, and improve your CI/CD pipelines in a type-safe manner.
GitHub Actions is powerful, but writing workflows can sometimes feel repetitive or tricky. That's where Rust GitHub Workflows steps in! 🦾
- 🔥 Rust-Powered: Leverage the performance and memory safety of Rust for writing workflows.
- 🧩 Modular & Reusable: Build workflows in a reusable, maintainable way.
- 📦 Crate-friendly: Seamless integration with your existing Rust projects.
- 🌍 Cross-platform: Target multiple operating systems and environments.
- Rust-based GitHub Actions: Create workflows and custom actions in Rust.
- Strong typing: Eliminate YAML errors with Rust's type safety.
- Easy setup: Get started quickly with minimal setup required.
- Expandability: Create your own actions in rust and use them as a cargo dependency.
To use Rust GitHub Workflows in your project, add it to your Cargo.toml
:
[dev-dependencies]
rust-gh-workflows = "1"
Then you can start creating GitHub Actions in your build.rs
with Rust like this:
use rust_gh_workflows::{Workflow, Job};
fn main() {
let workflow = Workflow::new("CI")
.job(
Job::new("build")
.runs_on("ubuntu-latest")
.steps(vec![
"checkout",
"setup-rust",
"cargo build --release"
]),
);
let yml = std:: workflow.generate();
std::fs::write(".github/workflows/ci.yml", yml).expect("Unable to write file");
- Github Actions Type System and Operators
- Custom action library support
- Documentation improvements
Rust provides the perfect combination of speed, safety, and flexibility, making it an ideal choice for writing GitHub Actions. With Rust, you get strong typing, memory safety, and the ability to reuse existing code, which can make your automation scripts more robust and maintainable.
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.
A big thank you to all the contributors who helped make this project a success! 🙏
If you like this project, please consider giving it a ⭐ on GitHub and share it with the community!
This project was inspired by the following repositories:
Happy automating with Rust! 🦀❤️