Skip to content

Commit

Permalink
Update GitHub pull request workflow
Browse files Browse the repository at this point in the history
This separates the linting, docs and format checks into separate jobs.
Also, since linting issues are now warnings, this ensures the linting
issues fail CI.
  • Loading branch information
MitMaro committed Jun 30, 2024
1 parent 7d95f27 commit 7af03d8
Showing 1 changed file with 32 additions and 14 deletions.
46 changes: 32 additions & 14 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ jobs:
runs-on: [ubuntu-latest]
timeout-minutes: 5
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
Expand All @@ -21,20 +22,37 @@ jobs:
run: cargo test
- name: Build
run: cargo build --release

lint:
runs-on: [ubuntu-latest]
timeout-minutes: 5
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- name: Install latest nightly Rust
uses: actions-rs/toolchain@v1
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- uses: baptiste0928/cargo-install@v2
with:
crate: cargo-make
- run: cargo clippy --all-targets --all-features --deny warnings
docs:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- run: cargo doc
format:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
profile: minimal
- name: Lint
run: "./scripts/lint.bash"
- name: Docs
run: "./scripts/docs.bash"
- name: Format
run: "./scripts/format.bash"
components: rustfmt
- uses: Swatinem/rust-cache@v2
- uses: baptiste0928/cargo-install@v2
with:
crate: cargo-make
- run: cargo make format

0 comments on commit 7af03d8

Please sign in to comment.