Files
bjarneo--cliamp/.github/workflows/ci.yml
T
Luguin 49c2cc7983 Enable Spotify support on Windows (#323)
go-librespot gained first-party WASAPI output for Windows in v0.9.0
(cliamp was pinned to v0.7.1, which doesn't compile on Windows). Bump
the dependency and remove the Windows CGO stub so the real provider
builds on all platforms.

CI now installs a MinGW toolchain via MSYS2 and builds/tests with
CGO_ENABLED=1 on windows-2025, including a workaround for an MSYS2
libogg packaging issue where libogg-0.dll's export table is missing
ogg_stream_iovecin even though it's present in the static libogg.a.

Verified locally end-to-end on Windows: native CGO build, full test
suite, and real Spotify Premium playback.

Fixes #299

Not in scope for this PR: release.yml still builds Windows with
CGO_ENABLED=0, so Releases binaries won't include Spotify until that
pipeline is updated separately (needs a packaging decision: bundle the
MSYS2 DLLs or pursue a fully static build).
2026-08-20 17:57:01 +02:00

75 lines
2.2 KiB
YAML

name: CI
on:
push:
pull_request:
permissions:
contents: read
jobs:
go:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- run: sudo apt-get update && sudo apt-get install -y libasound2-dev libflac-dev libvorbis-dev libogg-dev shellcheck
- run: go install honnef.co/go/tools/cmd/staticcheck@v0.6.1
- run: go install golang.org/x/vuln/cmd/govulncheck@v1.1.4
- run: make fmt-check vet staticcheck security
- run: go test -count=1 -race ./...
- run: make coverage
- run: shellcheck install.sh
- run: git diff --exit-code
build:
strategy:
fail-fast: false
matrix:
include:
- os: macos-14
goos: darwin
- os: windows-2025
goos: windows
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Install codec libs (macOS)
if: matrix.goos == 'darwin'
run: brew install flac libvorbis libogg pkg-config
- name: Set up MinGW toolchain (Windows)
if: matrix.goos == 'windows'
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: >-
mingw-w64-x86_64-gcc
mingw-w64-x86_64-pkg-config
mingw-w64-x86_64-libogg
mingw-w64-x86_64-libvorbis
mingw-w64-x86_64-flac
mingw-w64-x86_64-mpg123
- name: Test and build (Windows)
if: matrix.goos == 'windows'
env:
CGO_ENABLED: "1"
# Some MSYS2 libogg builds ship a libogg-0.dll whose export table is
# missing ogg_stream_iovecin, even though it's present in the static
# libogg.a. Force just that library to link statically.
CGO_LDFLAGS: "-Wl,-Bstatic -logg -Wl,-Bdynamic"
run: |
go test -count=1 ./...
go build -trimpath ./...
- name: Test and build (non-Windows)
if: matrix.goos != 'windows'
run: |
go test -count=1 ./...
go build -trimpath ./...