-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
173 lines (155 loc) · 6.07 KB
/
mediasoup-worker.yaml
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
name: mediasoup-worker
on: [pull_request, workflow_dispatch]
concurrency:
# Cancel a currently running workflow from the same PR, branch or tag when a
# new workflow is triggered.
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
ci:
strategy:
# Here we want to see all errors, not just the first one.
fail-fast: false
matrix:
build:
- os: ubuntu-20.04
cc: gcc
cxx: g++
# Workaround for this issue in Ubunt 20.04:
# https://github.com/versatica/mediasoup/actions/runs/9992113733/job/27616379442?pr=1427
workaround-ubuntu-20-04: true
run-test-asan-address: true
# Skip test-asan-undefined in Linux with GCC due to a bug in GCC
# that affects abseil-cpp:
# https://github.com/abseil/abseil-cpp/issues/1634
run-test-asan-undefined: false
run-test-asan-thread: true
- os: ubuntu-20.04
cc: clang
cxx: clang++
workaround-ubuntu-20-04: true
run-test-asan-address: true
run-test-asan-undefined: true
run-test-asan-thread: true
- os: ubuntu-22.04
cc: gcc
cxx: g++
run-test-asan-address: true
run-test-asan-undefined: false
run-test-asan-thread: true
- os: ubuntu-22.04
cc: clang
cxx: clang++
run-test-asan-address: true
run-test-asan-undefined: true
run-test-asan-thread: true
- os: ubuntu-24.04
cc: gcc
cxx: g++
pip-break-system-packages: true
run-test-asan-address: true
run-test-asan-undefined: false
run-test-asan-thread: true
- os: ubuntu-24.04
cc: clang
cxx: clang++
pip-break-system-packages: true
run-test-asan-address: true
run-test-asan-undefined: true
run-test-asan-thread: true
- os: macos-13
cc: gcc
cxx: g++
pip-break-system-packages: true
# Address Sanitizer does not work on MacOS.
run-test-asan-address: false
run-test-asan-undefined: false
run-test-asan-thread: false
- os: macos-14
cc: clang
cxx: clang++
pip-break-system-packages: true
run-test-asan-address: false
run-test-asan-undefined: false
run-test-asan-thread: false
- os: macos-15
cc: clang
cxx: clang++
pip-break-system-packages: true
run-test-asan-address: false
run-test-asan-undefined: false
run-test-asan-thread: false
- os: windows-2022
cc: cl
cxx: cl
# Address Sanitizer does not work on Windows.
run-test-asan-address: false
run-test-asan-undefined: false
run-test-asan-thread: false
# A single Node.js version should be fine for C++.
node:
- 22
build-type:
- Release
- Debug
runs-on: ${{ matrix.build.os }}
env:
CC: ${{ matrix.build.cc }}
CXX: ${{ matrix.build.cxx }}
MEDIASOUP_SKIP_WORKER_PREBUILT_DOWNLOAD: 'true'
MEDIASOUP_LOCAL_DEV: 'false'
MEDIASOUP_BUILDTYPE: ${{ matrix.build-type }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Configure cache
uses: actions/cache@v3
with:
path: |
~/.npm
key: ${{ matrix.build.os }}-node-${{matrix.build.cc}}-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ matrix.build.os }}-node-${{matrix.build.cc}}-
# We need to install pip invoke manually.
- if: ${{ !matrix.build.pip-break-system-packages }}
name: pip3 install invoke
run: pip3 install invoke
# In modern OSs we need to run pip with this option.
- if: ${{ matrix.build.pip-break-system-packages }}
name: pip3 install --break-system-packages invoke
run: pip3 install --break-system-packages invoke
# We need to install npm deps of worker/scripts/package.json.
- if: runner.os != 'Windows'
name: npm ci --prefix worker/scripts
run: npm ci --prefix worker/scripts --foreground-scripts
# Workaround for this issue in Ubuntu 20.04:
# https://github.com/versatica/mediasoup/actions/runs/9992113733/job/27616379442?pr=1427
- if: ${{ matrix.build.workaround-ubuntu-20-04 }}
name: workaround for Ubuntu 20.04
run: sudo apt install -y libgcc-10-dev && sudo ln -s /usr/lib/gcc/x86_64-linux-gnu/10/libtsan_preinit.o /usr/lib/libtsan_preinit.o
# NOTE: Maybe make it work on Windows someday.
- if: runner.os != 'Windows'
name: invoke -r worker lint
run: invoke -r worker lint
- name: invoke -r worker mediasoup-worker
run: invoke -r worker mediasoup-worker
# NOTE: Maybe make it work on Windows someday.
- if: runner.os != 'Windows'
name: invoke -r worker test
run: invoke -r worker test
# Let's clean everything before rebuilding worker tests with ASAN.
- if: ${{ matrix.build.run-test-asan-address }}
name: invoke -r worker test-asan-address
run: invoke -r worker clean-all && invoke -r worker test-asan-address
# Let's clean everything before rebuilding worker tests with ASAN.
- if: ${{ matrix.build.run-test-asan-undefined }}
name: invoke -r worker test-asan-undefined
run: invoke -r worker clean-all && invoke -r worker test-asan-undefined
# Let's clean everything before rebuilding worker tests with ASAN.
- if: ${{ matrix.build.run-test-asan-thread }}
name: invoke -r worker test-asan-thread
run: invoke -r worker clean-all && invoke -r worker test-asan-thread