Skip to content

Commit

Permalink
update ci.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
ssddOnTop committed Nov 22, 2024
1 parent 2a602c8 commit 0610ebf
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,17 @@ jobs:
toolchain: stable, nightly
components: clippy, rustfmt
- name: Cargo Test
if: env.LINT_MODE == 'check'
run: cargo test --all-features --workspace
- name: Cargo Fmt
if: env.LINT_MODE == 'check'
run: cargo +nightly fmt --check
- name: Cargo Test
if: env.LINT_MODE == 'fix'
run: cargo test --all --all-targets --all-features --fix --allow-staged --allow-dirty
- name: Cargo Fmt
if: env.LINT_MODE == 'fix'
run: cargo +nightly fmt --all
- name: Cargo Clippy
run: cargo +nightly clippy --all-features --workspace -- -D warnings
- name: Commit and push if changed
Expand Down
15 changes: 15 additions & 0 deletions tests/ci.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,27 @@ fn generate() {
.add_step(
Cargo::new("test")
.args("--all-features --workspace")
.if_condition("env.LINT_MODE == 'check'")
.name("Cargo Test"),
)
.add_step(
Cargo::new("fmt")
.nightly()
.args("--check")
.if_condition("env.LINT_MODE == 'check'")
.name("Cargo Fmt"),
)
.add_step(
Cargo::new("test")
.args("--all --all-targets --all-features --fix --allow-staged --allow-dirty")
.if_condition("env.LINT_MODE == 'fix'")
.name("Cargo Test"),
)
.add_step(
Cargo::new("fmt")
.nightly()
.args("--all")
.if_condition("env.LINT_MODE == 'fix'")
.name("Cargo Fmt"),
)
.add_step(
Expand Down

0 comments on commit 0610ebf

Please sign in to comment.