forked from Rockbox/rockbox
-
-
Notifications
You must be signed in to change notification settings - Fork 4
69 lines (60 loc) · 2.16 KB
/
Copy pathbindings-go-test.yml
File metadata and controls
69 lines (60 loc) · 2.16 KB
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: bindings-go-test
# Build librockbox_ffi and run the Go binding's test suite. The tests dlopen
# the freshly built shared library (via the target/release fallback) and run
# the same native pipeline parity check as the other bindings.
on:
push:
paths:
- "bindings/go/**"
- "crates/rockbox-ffi/**"
- "include/rockbox_ffi.h"
- ".github/workflows/bindings-go-test.yml"
pull_request:
paths:
- "bindings/go/**"
- "crates/rockbox-ffi/**"
- "include/rockbox_ffi.h"
- ".github/workflows/bindings-go-test.yml"
workflow_dispatch:
jobs:
test:
name: go test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: actions/setup-go@v5
with:
# Pin 1.26.2: its internal linker emits the LC_UUID Mach-O load
# command, which purego's runtime dlopen requires on macOS. Older
# toolchains omit it and dyld aborts the test binary. go.mod keeps a
# lower minimum (1.22) so consumers aren't forced onto 1.26.
go-version: "1.26.2"
cache-dependency-path: bindings/go/go.sum
- name: Install Linux audio deps
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install -y libasound2-dev pkg-config
- name: Load dummy sound card (best-effort)
if: startsWith(matrix.os, 'ubuntu')
run: sudo modprobe snd-dummy || true
- name: Build librockbox_ffi
run: cargo build --release -p rockbox-ffi
- name: go vet
working-directory: bindings/go
# -unsafeptr=false: purego hands back C-owned addresses as uintptr, so
# the uintptr->unsafe.Pointer conversions are safe (not GC-managed) but
# the unsafeptr analyzer can't prove it. Every other check still runs.
run: go vet -unsafeptr=false ./...
- name: go test
working-directory: bindings/go
run: go test -v ./...