From 2ce725c76b2b78abca3d74cdc550215c94be2785 Mon Sep 17 00:00:00 2001 From: Noa Aarts Date: Tue, 22 Oct 2024 22:58:33 +0200 Subject: [PATCH] workflows: Rust toolchain (#31) Make the rust flow fast, though it doesn't build for windows and mac anymore --- .github/workflows/rust.yml | 72 +++++++++++--------------------------- 1 file changed, 21 insertions(+), 51 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index bfa6e54..fa323f9 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -1,4 +1,4 @@ -name: CI +name: rust build on: push: @@ -9,48 +9,27 @@ permissions: contents: read jobs: - pre_ci: - uses: dtolnay/.github/.github/workflows/pre_ci.yml@master - - test: - name: ${{matrix.name || format('Rust {0}', matrix.rust)}} - needs: pre_ci - if: needs.pre_ci.outputs.continue - runs-on: ${{matrix.os}}-latest - strategy: - fail-fast: false - matrix: - rust: [nightly] - os: [ubuntu] - include: - - name: macOS - os: macos - rust: nightly - - name: Windows (gnu) - os: windows - rust: nightly-x86_64-pc-windows-gnu - - name: Windows (msvc) - os: windows - rust: nightly-x86_64-pc-windows-msvc - timeout-minutes: 45 + check: + name: cargo check + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@master + - uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: ${{matrix.rust}} - - name: Enable type layout randomization - run: echo -Zrandomize-layout\ --cfg=exhaustive >> $GITHUB_ENV - if: matrix.rust == 'nightly' - - run: cargo check --locked - - run: cargo update + toolchain: nightly - run: cargo check - - run: cargo test - if: matrix.os == 'ubuntu' && matrix.rust == 'nightly' - - uses: actions/upload-artifact@v4 - if: matrix.os == 'ubuntu' && matrix.rust == 'nightly' && always() + + test: + name: cargo test + runs-on: ubuntu-latest + needs: check + steps: + - uses: actions/checkout@v4 + - uses: actions-rust-lang/setup-rust-toolchain@v1 with: - name: Cargo.lock - path: Cargo.lock + toolchain: nightly + - run: cargo test + clippy: name: Clippy @@ -59,17 +38,8 @@ jobs: timeout-minutes: 45 steps: - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@clippy + - uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + toolchain: nightly + components: clippy - run: cargo clippy --tests -- -Dclippy::all - - # outdated: - # name: Outdated - # runs-on: ubuntu-latest - # if: github.event_name != 'pull_request' - # timeout-minutes: 45 - # steps: - # - uses: actions/checkout@v4 - # - uses: dtolnay/rust-toolchain@stable - # - uses: dtolnay/install@cargo-outdated - # - run: cargo update - # - run: cargo outdated --workspace --exit-code 1