Skip to content

Commit

Permalink
split into lint file
Browse files Browse the repository at this point in the history
  • Loading branch information
zerosnacks committed Mar 26, 2024
1 parent db68a85 commit a217275
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 25 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Runs `clippy` and `cargo fmt` checks.

name: Lint

on:
push:
branches: [main]
pull_request:

env:
CARGO_TERM_COLOR: always

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
clippy:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@clippy
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- run: cargo clippy --workspace --all-targets --all-features
env:
RUSTFLAGS: -Dwarnings

fmt:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- run: cargo fmt --all --check
29 changes: 4 additions & 25 deletions .github/workflows/ci.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
name: CI
# Runs build checks and examples.

name: Test

on:
push:
Expand Down Expand Up @@ -57,27 +59,4 @@ jobs:
echo "Running the following examples: $examples"
# Run the examples
echo "$examples" | xargs -n1 cargo run --example
clippy:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@clippy
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- run: cargo clippy --workspace --all-targets --all-features
env:
RUSTFLAGS: -Dwarnings

fmt:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- run: cargo fmt --all --check
echo "$examples" | xargs -n1 cargo run --example

0 comments on commit a217275

Please sign in to comment.