Skip to content

Commit

Permalink
Use newer rust toolchain action
Browse files Browse the repository at this point in the history
  • Loading branch information
Palmr committed Oct 21, 2024
1 parent 38137e7 commit c1523dc
Showing 1 changed file with 30 additions and 38 deletions.
68 changes: 30 additions & 38 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,62 +3,54 @@ on: [push, pull_request]
name: Rust

jobs:
check:
name: Check
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: check
components: rustfmt
- name: Run build
run: cargo build --verbose

test:
name: Test Suite
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: test
components: rustfmt
- name: Run tests
run: cargo test --verbose

fmt:
name: Rustfmt
rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
profile: minimal
toolchain: stable
override: true
- run: rustup component add rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
components: rustfmt
- name: Check formatting
run: cargo fmt --all --check

clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
profile: minimal
toolchain: stable
override: true
- run: rustup component add clippy
- uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
components: clippy
- name: Run linter
run: cargo clippy -- -D warnings

0 comments on commit c1523dc

Please sign in to comment.