Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 43 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ name: build
- "**/Dockerfile*"
- "test.sh"
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]
paths-ignore:
- "**.md"
- "docs/**"
Expand All @@ -29,6 +30,8 @@ name: build
env:
RUST_BACKTRACE: 1
RUSTFLAGS: -D warnings
GSTREAMER_WIN_PATH: D:\gstreamer
NOT_WINDOWS_FEATURES: alsa-backend,pulseaudio-backend,jackaudio-backend,rodiojack-backend,with-avahi,with-dns-sd

jobs:
test:
Expand All @@ -40,6 +43,16 @@ jobs:
toolchain:
- "1.85" # MSRV (Minimum supported rust version)
- stable
isPR:
- ${{ github.event_name == 'pull_request' }}
isCIWindows:
- ${{ github.event.pull_request && contains(github.event.pull_request.labels.*.name, format('CI{0} Windows', ':')) }}
exclude:
# excludes windows in a PR by default, unless labeled with 'CI: Windows'
- os: 'windows-latest'
isPR: true
isCIWindows: false

steps:
- name: Checkout code
uses: actions/checkout@v5
Expand All @@ -60,6 +73,22 @@ jobs:
gstreamer1.0-dev libgstreamer-plugins-base1.0-dev
libavahi-compat-libdnssd-dev

- name: Install developer package dependencies (Windows)
if: runner.os == 'Windows'
run: choco install pkgconfiglite

- name: Cache gstreamer (Windows)
uses: actions/cache@v4
id: cache-gstreamer
if: runner.os == 'Windows'
with:
path: ${{ env.GSTREAMER_WIN_PATH }}
key: gstreamer-Windows-${{ hashFiles('**/Cargo.lock') }}

- name: Install gstreamer (Windows)
if: ${{ runner.os == 'Windows' && !steps.cache-gstreamer.outputs.cache-hit }}
run: choco install gstreamer-devel

- name: Fetch dependencies
run: cargo fetch --locked

Expand All @@ -72,27 +101,26 @@ jobs:
- 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
- name: Check binary with any tls option
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
cargo hack check -p librespot --each-feature
--exclude-no-default-features --exclude-all-features
--include-features native-tls,rustls-tls-native-roots,rustls-tls-webpki-roots

- name: Check workspace with rustls-tls-native-roots
- name: Check binary features (cross-platform)
env:
PKG_CONFIG_PATH: ${{ env.GSTREAMER_WIN_PATH }}\1.0\msvc_x86_64\lib\pkgconfig
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
cargo hack check -p librespot --each-feature
--exclude-no-default-features --exclude-all-features --features native-tls
--exclude-features rustls-tls-native-roots,rustls-tls-webpki-roots,${{ env.NOT_WINDOWS_FEATURES }}

- name: Check discovery features (Linux only)
- name: Check binary features (linux)
if: runner.os == 'Linux'
run: >
cargo hack check -p librespot-discovery --each-feature --exclude-all-features
--include-features native-tls
--exclude-features rustls-tls-native-roots,rustls-tls-webpki-roots
cargo hack check -p librespot --each-feature
--exclude-no-default-features --exclude-all-features --features native-tls
--include-features ${{ env.NOT_WINDOWS_FEATURES }}

- name: Build binary with default features
run: cargo build --frozen
Expand Down
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,6 @@ rustls-tls-webpki-roots = [
# on macOS.
rodio-backend = ["librespot-playback/rodio-backend"]

# rodiojack-backend: Rodio backend with JACK support for professional audio setups.
rodiojack-backend = ["librespot-playback/rodiojack-backend"]

# gstreamer-backend: Uses GStreamer multimedia framework for audio output.
# Provides extensive audio processing capabilities.
gstreamer-backend = ["librespot-playback/gstreamer-backend"]
Expand All @@ -105,6 +102,9 @@ pulseaudio-backend = ["librespot-playback/pulseaudio-backend"]
# Professional audio backend for low-latency, high-quality audio routing.
jackaudio-backend = ["librespot-playback/jackaudio-backend"]

# rodiojack-backend: Rodio backend with JACK support for professional audio setups. (not windows, yet)
rodiojack-backend = ["librespot-playback/rodiojack-backend"]

# Network discovery backends - choose one for Spotify Connect device discovery
# See COMPILING.md for dependencies and platform support.

Expand All @@ -119,7 +119,7 @@ with-libmdns = ["librespot-discovery/with-libmdns"]
# libavahi-client-dev.
with-avahi = ["librespot-discovery/with-avahi"]

# with-dns-sd: Uses DNS Service Discovery (cross-platform).
# with-dns-sd: Uses DNS Service Discovery (Linux and macOS only).
# On macOS uses Bonjour, on Linux uses Avahi compatibility layer. Choose this for tight system
# integration on macOS or when using Avahi's dns-sd compatibility mode on Linux.
with-dns-sd = ["librespot-discovery/with-dns-sd"]
Expand Down