1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: CI
# Branch pushes are covered by `pull_request`; limiting `push` to main keeps a
# commit on a PR branch from running the whole matrix twice.
on:
push:
branches:
pull_request:
# A new push supersedes whatever was still running for the same ref.
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "-D warnings"
jobs:
nix-build:
name: Nix build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/determinate-nix-action@v3
- name: Check flake
run: nix flake check --no-update-lock-file --print-build-logs
- name: Build with Nix
run: nix build --no-update-lock-file --print-build-logs
test:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# Windows is a supported target (Cargo.toml has a cfg(windows) section
# and souvlaki ships a Windows backend), but it was never built in CI —
# which is exactly how an ungated `std::os::unix::net::UnixStream` in
# the MXC layer reached a PR. Building it here makes that class of
# regression impossible to merge.
os:
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
# librespot's ALSA backend and native-tls need these; macOS has them.
- name: Install Linux audio/TLS headers
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y libasound2-dev pkg-config
- name: Format
run: cargo fmt --all --check
- name: Clippy
run: cargo clippy --all-targets --all-features
# The `#[ignore]`d live tests talk to Spotify and need a real account, so
# they stay out of CI; everything else runs.
- name: Test
run: cargo test --all-features