Repository navigation
56 lines (53 loc) · 2.22 KB
/
Copy pathci.yml
File metadata and controls
56 lines (53 loc) · 2.22 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
name: ci
on:
push:
branches: [ main ]
pull_request:
workflow_dispatch:
jobs:
# Portable core (codec, backpressure queue, Pipecat protobuf) — no FreeSWITCH needed,
# so this runs everywhere and is the primary green signal.
unit:
name: unit tests (portable core)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install build tools
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends build-essential cmake
- name: Configure & build tests
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release && cmake --build build --target test_codec test_pb test_cmdguard test_command_dispatch test_proto_audio --parallel
- name: Run tests
run: ctest --test-dir build --output-on-failure
# The module itself needs FreeSWITCH dev headers (SignalWire apt repo, token-gated).
# Runs only when the SW_TOKEN secret is present; produces the .so and a .deb.
module:
name: build module + .deb (FS ${{ matrix.fs }})
runs-on: ubuntu-latest
needs: unit
# Compile mod_earshot.c on pushes AND on same-repo PRs (which have the secret) so a build
# break can't slip through PR review and land on main. Fork PRs (different head repo) get no
# secret, so they're skipped rather than failing.
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
strategy:
fail-fast: false
matrix:
fs: [ "1.10", "1.11" ]
steps:
- uses: actions/checkout@v4
- name: Build in Docker (installs libfreeswitch-dev when SW_TOKEN is set)
env:
SW_TOKEN: ${{ secrets.SW_TOKEN }}
run: |
if [ -z "$SW_TOKEN" ]; then
echo "::notice::SW_TOKEN secret not set — skipping module/.deb build (unit tests already passed)."
exit 0
fi
docker build --build-arg SW_TOKEN="$SW_TOKEN" -t earshot-build .
id=$(docker create earshot-build); docker cp "$id:/out" ./out; docker rm "$id"
ls -la out
- name: Upload artifacts
if: ${{ hashFiles('out/**') != '' }}
uses: actions/upload-artifact@v4
with:
name: mod_earshot-fs${{ matrix.fs }}
path: out/*