Skip to content

Commit 3810f4b

Browse files
committed
refactor: enhance workflow setup in README for improved clarity and functionality
1 parent 76bfb74 commit 3810f4b

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

README.md

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,26 @@ Then you can start creating GitHub Actions in your [tests/ci.rs](https://github.
3939

4040
#[test]
4141
fn main() {
42-
// Create a basic workflow
43-
let workflow = Workflow::setup_rust();
44-
45-
// Generate the ci.yml
46-
workflow.generate().unwrap();
42+
// Create a basic workflow
43+
let workflow = Workflow::default()
44+
.on(Event::default()
45+
.push(Push::default().add_branch("main"))
46+
.pull_request(PullRequest::default().add_branch("main")))
47+
.add_job("test", Job::new("Build & Test")
48+
.add_step(Step::checkout())
49+
.add_step(
50+
Step::toolchain()
51+
.add_nightly()
52+
.add_clippy()
53+
.add_fmt()
54+
.cache(true),
55+
)
56+
.add_step(Step::new("Cargo formatting").run("cargo +nightly fmt --all -- --check"))
57+
.add_step(Step::new("Cargo clippy").run("cargo +nightly clippy -- -D warnings"))
58+
.add_step(Step::new("Cargo tests").run("cargo test")));
59+
60+
// Generate the ci.yml
61+
workflow.generate().unwrap();
4762
}
4863
```
4964

0 commit comments

Comments
 (0)