Skip to content

Commit

Permalink
Make github actions more parallel and less redundant
Browse files Browse the repository at this point in the history
  • Loading branch information
TristanDebrunner committed Apr 23, 2024
1 parent 95a85f7 commit 1440a35
Showing 1 changed file with 73 additions and 12 deletions.
85 changes: 73 additions & 12 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,53 @@ env:
RUSTFLAGS: "-D warnings"

jobs:
fmt:
name: Format check
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2.7.0
- name: Versions
run: cargo --version && rustc --version && cargo fmt -- --version && cargo clippy -- --version
- run: cargo fmt --all -- --check

clippy:
name: Clippy check
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libssl-dev pkg-config libasound2-dev
version: latest
- uses: Swatinem/rust-cache@v2.7.0
- name: Versions
run: cargo --version && rustc --version && cargo fmt -- --version && cargo clippy -- --version
- run: cargo clippy --all -- --deny=warnings
- run: cargo clippy --all --no-default-features -- --deny=warnings

audit:
name: Carog audit
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions-rust-lang/audit@v1
with:
file: Cargo.lock

build:
name: Test debug on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
needs: [ fmt, clippy, audit ]

steps:
- uses: actions/checkout@v3
- if: ${{ matrix.os == 'ubuntu-latest' }}
uses: actions-rust-lang/audit@v1
with:
file: Cargo.lock
- if: ${{ matrix.os == 'ubuntu-latest' }}
uses: awalsh128/cache-apt-pkgs-action@latest
with:
Expand All @@ -33,19 +67,33 @@ jobs:
- uses: Swatinem/rust-cache@v2.7.0
- name: Versions
run: cargo --version && rustc --version && cargo fmt -- --version && cargo clippy -- --version
- run: cargo fmt --all -- --check
- run: cargo clippy --all -- --deny=warnings
- run: cargo clippy --all --no-default-features -- --deny=warnings
- run: cargo build --all
- run: cargo build --all --no-default-features
- run: cargo test --all

build-ndf:
name: Test debug without default features
runs-on: ubuntu-latest
needs: [ fmt, clippy, audit ]

steps:
- uses: actions/checkout@v3
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libssl-dev pkg-config libasound2-dev
version: latest
- uses: Swatinem/rust-cache@v2.7.0
- name: Versions
run: cargo --version && rustc --version && cargo fmt -- --version && cargo clippy -- --version
- run: cargo build --all --no-default-features
- run: cargo test --all --no-default-features

build-release:
name: Test release on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
needs: [ fmt, clippy, audit ]

steps:
- uses: actions/checkout@v3
Expand All @@ -57,10 +105,23 @@ jobs:
- uses: Swatinem/rust-cache@v2.7.0
- name: Versions
run: cargo --version && rustc --version && cargo fmt -- --version && cargo clippy -- --version
- run: cargo fmt --all -- --check
- run: cargo clippy --release --all -- --deny=warnings
- run: cargo clippy --release --all --no-default-features -- --deny=warnings
- run: cargo build --release --all
- run: cargo build --release --all --no-default-features
- run: cargo test --release --all

build-release-ndf:
name: Test release without default features
runs-on: ubuntu-latest
needs: [ fmt, clippy, audit ]

steps:
- uses: actions/checkout@v3
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libssl-dev pkg-config libasound2-dev
version: latest
- uses: Swatinem/rust-cache@v2.7.0
- name: Versions
run: cargo --version && rustc --version && cargo fmt -- --version && cargo clippy -- --version
- run: cargo build --release --all --no-default-features
- run: cargo test --release --all --no-default-features

0 comments on commit 1440a35

Please sign in to comment.