Skip to content

Commit

Permalink
CI: Modernise workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
str4d committed Jul 21, 2024
1 parent 81ff817 commit ed4bfca
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 13 deletions.
38 changes: 29 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,38 @@ name: CI checks
on: [push, pull_request]

jobs:
test:
name: Test on ${{ matrix.os }}
test-msrv:
name: Test MSRV on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Run tests
run: cargo test --verbose --release --features experimental,zeroize
- name: Verify working directory is clean
run: git diff --exit-code

test-latest:
name: Test latest on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
id: toolchain
- run: rustup override set ${{steps.toolchain.outputs.name}}
- name: Remove lockfile to build with latest dependencies
run: rm Cargo.lock
- name: Run tests
run: cargo test --verbose --release --features experimental,zeroize
- name: Verify working directory is clean (excluding lockfile)
run: git diff --exit-code ':!Cargo.lock'

no-std:
name: Check no-std target ${{ matrix.target }}
Expand All @@ -26,7 +47,7 @@ jobs:
- wasm32-wasi

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: rustup target add ${{ matrix.target }}
- run: cargo fetch
- name: Build
Expand All @@ -41,7 +62,7 @@ jobs:
name: Bitrot check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
# Build benchmarks and all-features to prevent bitrot
- name: Build benchmarks
run: cargo build --benches --examples --all-features
Expand All @@ -50,17 +71,16 @@ jobs:
name: Intra-doc links
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: cargo fetch
# Requires #![deny(rustdoc::broken_intra_doc_links)] in crate.
- name: Check intra-doc links
run: cargo doc --document-private-items

fmt:
name: Rustfmt
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Check formatting
run: cargo fmt --all -- --check
run: cargo fmt -- --check
3 changes: 1 addition & 2 deletions .github/workflows/lints-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ on: push
jobs:
clippy-beta:
name: Clippy (beta)
timeout-minutes: 30
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@beta
id: toolchain
- run: rustup override set ${{steps.toolchain.outputs.name}}
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/lints-stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ on: pull_request
jobs:
clippy:
name: Clippy (MSRV)
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Run clippy
uses: actions-rs/clippy-check@v1
with:
Expand Down

0 comments on commit ed4bfca

Please sign in to comment.