Skip to content

Commit

Permalink
Update rust.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
aevyrie authored Nov 10, 2023
1 parent 409f158 commit f663e64
Showing 1 changed file with 60 additions and 24 deletions.
84 changes: 60 additions & 24 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,72 @@
name: CI
on:
pull_request:
push:
branches:
- main

name: CI

jobs:
ci:
name: CI
setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable

- name: Update Packages
run: sudo apt-get update -yq

- name: Install dependencies
run: sudo apt-get install -yq --no-install-recommends libudev-dev libasound2-dev libxcb-composite0-dev

- name: Cache Dependencies
uses: Swatinem/rust-cache@ce325b60658c1b38465c06cc965b79baf32c1e72

- name: Format
run: cargo fmt --all -- --check

- name: Check
run: cargo check --all-targets

- name: Clippy
run: cargo clippy --all-targets -- -D warnings

- name: Test
run: cargo test --all-targets

format:
runs-on: ubuntu-latest
needs: [setup]
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/[email protected]
- run: rustup component add rustfmt
- run: cargo fmt --all -- --check

check:
runs-on: ubuntu-latest
needs: [setup]
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/[email protected]
- run: cargo check --workspace --all-features --all-targets

check-no-defaults:
runs-on: ubuntu-latest
needs: [setup]
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/[email protected]
- run: cargo check --workspace --no-default-features --all-targets

clippy:
runs-on: ubuntu-latest
needs: [setup]
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/[email protected]
- run: rustup component add clippy
- run: cargo clippy --workspace --all-features --all-targets -- -D warnings

doc:
runs-on: ubuntu-latest
needs: [setup]
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/[email protected]
- run: cargo doc --workspace --all-features
env:
RUSTDOCFLAGS: -D warnings

test:
runs-on: ubuntu-latest
needs: [setup]
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/[email protected]
- run: cargo test --workspace --all-features --all-targets

0 comments on commit f663e64

Please sign in to comment.