feat: add CI and release workflows for automated testing and deployment #1
This file contains hidden or 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 | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| rustfmt-clippy: | |
| name: Rustfmt & Clippy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt, clippy | |
| - run: cargo fmt --all -- --check | |
| - run: cargo clippy --workspace --all-targets -- -D warnings | |
| test: | |
| name: Test (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Install deps (Linux) | |
| if: matrix.os == 'ubuntu-latest' | |
| run: sudo apt-get update && sudo apt-get install -y libopus-dev libasound2-dev libsamplerate0-dev pkg-config libssl-dev cmake build-essential | |
| - name: Install deps (macOS) | |
| if: matrix.os == 'macos-latest' | |
| run: brew install cmake pkg-config opus libsndfile samplerate | |
| - name: Install deps (Windows) | |
| if: matrix.os == 'windows-latest' | |
| run: choco install cmake pkgconfiglite | |
| - run: cargo build --verbose | |
| - run: cargo test --verbose |