build #11
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
| --- | |
| # Note, this is used in the badge URL! | |
| name: build | |
| "on": | |
| push: | |
| branches: [dev, master] | |
| paths-ignore: | |
| - "**.md" | |
| - "docs/**" | |
| - "contrib/**" | |
| - "LICENSE" | |
| - "*.sh" | |
| - "**/Dockerfile*" | |
| - "publish.sh" | |
| - "test.sh" | |
| pull_request: | |
| paths-ignore: | |
| - "**.md" | |
| - "docs/**" | |
| - "contrib/**" | |
| - "LICENSE" | |
| - "*.sh" | |
| - "**/Dockerfile*" | |
| - "publish.sh" | |
| - "test.sh" | |
| schedule: | |
| # Run CI every week | |
| - cron: "00 01 * * 0" | |
| env: | |
| RUST_BACKTRACE: 1 | |
| RUSTFLAGS: -D warnings | |
| jobs: | |
| test: | |
| name: cargo +${{ matrix.toolchain }} test (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| toolchain: | |
| - "1.85" # MSRV (Minimum supported rust version) | |
| - stable | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ matrix.toolchain }} | |
| - name: Cache Rust dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Install developer package dependencies (Linux) | |
| if: runner.os == 'Linux' | |
| run: > | |
| sudo apt-get update && sudo apt-get install -y | |
| libpulse-dev portaudio19-dev libasound2-dev libsdl2-dev | |
| gstreamer1.0-dev libgstreamer-plugins-base1.0-dev | |
| libavahi-compat-libdnssd-dev | |
| - name: Fetch dependencies | |
| run: cargo fetch --locked | |
| - name: Build workspace with examples | |
| run: cargo build --frozen --workspace --examples | |
| - name: Run tests | |
| run: cargo test --workspace | |
| - name: Install cargo-hack | |
| uses: taiki-e/install-action@cargo-hack | |
| - name: Check packages without TLS requirements | |
| run: cargo hack check -p librespot-protocol --each-feature | |
| - name: Check workspace with native-tls | |
| run: > | |
| cargo hack check -p librespot --each-feature --exclude-all-features | |
| --include-features native-tls | |
| --exclude-features rustls-tls-native-roots,rustls-tls-webpki-roots | |
| - name: Check workspace with rustls-tls-native-roots | |
| run: > | |
| cargo hack check -p librespot --each-feature --exclude-all-features | |
| --include-features rustls-tls-native-roots | |
| --exclude-features native-tls,rustls-tls-webpki-roots | |
| - name: Build binary with default features | |
| run: cargo build --frozen | |
| - name: Upload debug artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: librespot-${{ matrix.os }}-${{ matrix.toolchain }} | |
| path: > | |
| target/debug/librespot${{ runner.os == 'Windows' && '.exe' || '' }} | |
| if-no-files-found: error |