File tree Expand file tree Collapse file tree 1 file changed +20
-5
lines changed Expand file tree Collapse file tree 1 file changed +20
-5
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments