workflows: Rust toolchain (#31)

Make the rust flow fast, though it doesn't build for windows and mac
anymore
This commit is contained in:
Noa Aarts 2024-10-22 22:58:33 +02:00 committed by GitHub
parent 7f04b39a15
commit 2ce725c76b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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