+ +
6452af3 fix(ci): add socket recv timeouts and ctest watchdog to prevent runner deadlocks
saifmukhtar · 2026-11-25
1 name: CI (Multi-Platform Build & Verification)
2  
3 on:
4 push:
5 pull_request:
6 workflow_dispatch:
7  
8 concurrency:
9 group: ci-${{ github.workflow }}-${{ github.ref }}
10 cancel-in-progress: true
11  
12 jobs:
13 # ============================================================================
14 # 1. Fast Repository & ABI Hygiene Checks
15 # ============================================================================
16 hygiene:
17 name: Hygiene (SPDX & Symbol Map)
18 runs-on: ubuntu-22.04
19  
20 steps:
21 - name: Checkout Repository
22 uses: actions/checkout@v7
23  
24 - name: Verify SPDX License Headers
25 run: |
26 missing=0
27 # Verify native files have AGPL-3.0-or-later WITH Classpath-exception-2.0
28 for f in include/*.h include/*.hpp src/*.c tools/*.c tools/*.h test/*.c test/*.cpp fuzz/*.c; do
29 if [ "$f" = "include/avx_speedhq.h" ] || [ "$f" = "src/avx_speedhq.c" ]; then
30 continue
31 fi
32 if ! grep -q "SPDX-License-Identifier: AGPL-3.0-or-later WITH Classpath-exception-2.0" "$f"; then
33 echo "Missing AGPL SPDX header: $f"
34 missing=1
35 fi
36 done
37 # Verify SpeedHQ has LGPL-2.1-or-later per upstream FFmpeg derivation
38 for f in include/avx_speedhq.h src/avx_speedhq.c; do
39 if ! grep -q "SPDX-License-Identifier: LGPL-2.1-or-later" "$f"; then
40 echo "Missing LGPL-2.1-or-later SPDX header: $f"
41 missing=1
42 fi
43 done
44 exit "$missing"
45  
46 - name: Verify Public OPENAVX_API Exports in openavx.map
47 run: |
48 python3 - << 'EOF'
49 import glob, pathlib, re, sys
50  
51 map_txt = pathlib.Path("openavx.map").read_text()
52 map_syms = set(re.findall(r"\b([A-Za-z_][A-Za-z0-9_]*)\s*;", map_txt))
53  
54 missing = []
55 for path in sorted(glob.glob("include/*.h")):
56 name = pathlib.Path(path).name
57 if name == "avx_internal.h":
58 continue
59 txt = re.sub(r"/\*.*?\*/", " ", pathlib.Path(path).read_text(), flags=re.S)
60 txt = re.sub(r"\s+", " ", txt)
61 for m in re.finditer(r"OPENAVX_API\s+[^;()]+?\b([A-Za-z_][A-Za-z0-9_]*)\s*\(", txt):
62 sym = m.group(1)
63 if sym not in map_syms:
64 missing.append((name, sym))
65  
66 if missing:
67 for hdr, sym in missing:
68 print(f"Missing in openavx.map: {sym} (declared in include/{hdr})")
69 sys.exit(1)
70 print("All public OPENAVX_API symbols present in openavx.map")
71 EOF
72  
73 # ============================================================================
74 # 2. Multi-OS Strict C99 Build, CTest & Install Verification
75 # ============================================================================
76 cmake-matrix:
77 name: CMake C99 & CTest (${{ matrix.os }})
78 runs-on: ${{ matrix.os }}
79 strategy:
80 fail-fast: false
81 matrix:
82 os: [ubuntu-22.04, macos-15, windows-2025]
83  
84 steps:
85 - name: Checkout Repository
86 uses: actions/checkout@v7
87  
88 - name: Configure CMake (Strict C99)
89 run: cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_EXTENSIONS=OFF -DBUILD_TESTING=ON
90  
91 - name: Build Library, CLI & Tests
92 run: cmake --build build --config Release -j
93  
94 - name: Run CTest Suite
95 run: ctest --test-dir build -C Release --output-on-failure --timeout 90
96  
97 - name: Verify Staging Install
98 run: cmake --install build --config Release --prefix "${{ github.workspace }}/install_test"
99  
100 # ============================================================================
101 # 3. Alpine Linux (musl libc) Container Build & Verification
102 # ============================================================================
103 alpine-musl:
104 name: Alpine Linux (musl libc)
105 runs-on: ubuntu-22.04
106 container:
107 image: alpine:3.20
108  
109 steps:
110 - name: Install Toolchain & Dependencies
111 run: apk add --no-cache git build-base cmake linux-headers ffmpeg-dev
112  
113 - name: Checkout Repository
114 uses: actions/checkout@v7
115  
116 - name: Configure CMake
117 run: cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_EXTENSIONS=OFF -DBUILD_TESTING=ON
118  
119 - name: Build Library, CLI & Tests
120 run: cmake --build build --config Release -j$(nproc)
121  
122 - name: Run CTest Suite
123 run: ctest --test-dir build -C Release --output-on-failure --timeout 90
124  
125 - name: Verify Staging Install
126 run: cmake --install build --config Release --prefix "${{ github.workspace }}/install_test"