-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add
Workflow::setup_rust()
helper
- Loading branch information
1 parent
f74da3d
commit 5a3f184
Showing
6 changed files
with
55 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,5 @@ | ||
use gh_workflow::*; | ||
|
||
fn main() { | ||
let job_build = Job::new("Build and Test") | ||
.add_step(Step::checkout()) | ||
.add_step( | ||
Step::setup_rust() | ||
.toolchain_stable() | ||
.toolchain_nightly() | ||
.component_clippy() | ||
.component_rustfmt(), | ||
) | ||
// TODO: Improve type-safety and intellisense | ||
.add_step(Step::cargo("test", vec!["--all-features", "--workspace"])) | ||
.add_step(Step::cargo_nightly("fmt", vec!["--check"])) | ||
.add_step(Step::cargo_nightly( | ||
"clippy", | ||
vec!["--all-features", "--workspace", "--", "-D warnings"], | ||
)); | ||
|
||
let on_push = Event::push().branch("main"); | ||
|
||
let on_pull_request = Event::pull_request_target() | ||
.open() | ||
.synchronize() | ||
.reopen() | ||
.branch("main"); | ||
|
||
let rust_flags = RustFlags::deny("warnings"); | ||
|
||
Workflow::new("CI") | ||
.env(rust_flags) | ||
.permissions(Permissions::read()) | ||
.on(on_push) | ||
.on(on_pull_request) | ||
.add_job("build", job_build) | ||
.generate() | ||
.unwrap(); | ||
Workflow::setup_rust().generate().unwrap(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters