change CI #146
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI test and lint | |
on: | |
push: | |
branches: [ main, master ] | |
pull_request: | |
branches: [ main, master ] | |
jobs: | |
check_test: | |
name: Check and test | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [macos-latest, windows-latest, ubuntu-latest] | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: install linux deps | |
run: | | |
sudo apt update | |
sudo apt install -y --no-install-recommends libasound2-dev | |
if: contains(matrix.os, 'ubuntu') | |
- name: Install toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- name: Rust cache | |
uses: Swatinem/rust-cache@v2 | |
- name: Run cargo check | |
run: cargo check --workspace --all-features | |
- name: Run cargo test | |
run: cargo test --workspace --all-features -- --skip clear_test --skip play_test --skip audio_devices_test | |
lints: | |
name: Lints | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [macos-latest, windows-latest, ubuntu-latest] | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: install linux deps | |
run: | | |
sudo apt update | |
sudo apt install -y --no-install-recommends libasound2-dev | |
if: contains(matrix.os, 'ubuntu') | |
- name: Install toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
components: rustfmt, clippy | |
- name: Rust cache | |
uses: Swatinem/rust-cache@v2 | |
- name: Run cargo fmt | |
run: cargo fmt --all -- --check | |
- name: Run cargo clippy | |
run: cargo clippy --workspace --all-features --tests -- -Dwarnings | |