1
0
Fork 0
mirror of https://github.com/librespot-org/librespot.git synced 2025-10-03 01:39:28 +02:00
librespot/.github/workflows/build.yml
Roderick van Domburg 78ce118d32
fix: rustls-tls features to support certificate stores (#1542)
Add separate features for native system roots and Mozilla webpki roots.
Update documentation and build configs to reflect new options.
2025-08-20 11:31:13 +02:00

101 lines
2.7 KiB
YAML

---
# 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