From f556df81c4db33e831fdfbbe21a1e7cb53fe08b4 Mon Sep 17 00:00:00 2001 From: Tim Oram Date: Sun, 30 Jun 2024 13:04:20 -0230 Subject: [PATCH] Update GitHub pull request workflow 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. --- .github/workflows/pull-request.yml | 46 +++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 14 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index fe2de5e..14f7aca 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -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: @@ -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