-
-
Notifications
You must be signed in to change notification settings - Fork 133
206 lines (198 loc) · 8.35 KB
/
ringrtc.yml
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
name: RingRTC CI
on:
push:
branches: [ main, 'staging/*' ]
pull_request: # all target branches
jobs:
code_formatting:
name: Code Formatting
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- run: rustup toolchain install $(cat rust-toolchain) --profile minimal --component rustfmt
- name: Check rust format
run: cargo fmt -- --check
- name: Install for node
run: npm ci
working-directory: src/node
- name: Check typescript format
run: npm run check-format
working-directory: src/node
lints:
name: Lints
runs-on: ubuntu-22.04
steps:
- name: Install deps
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler libpulse-dev
- name: Install Python tools
run: pip3 install flake8 mypy
- uses: actions/checkout@v4
- name: Cargo Cache
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
with:
cache-targets: "false"
- run: rustup toolchain install $(cat rust-toolchain) --profile minimal --component clippy --target aarch64-linux-android,aarch64-apple-ios
- name: Install extra Rust tools
run: cargo +stable install --version 0.6.2 --locked cargo-about
- run: shellcheck **/*.sh bin/build-aar bin/build-call_sim-cli bin/build-direct bin/build-electron bin/build-gctc bin/build-ios bin/build-javadoc bin/build-rustdoc bin/build-target bin/fetch-artifact bin/gsync-webrtc bin/prepare-workspace bin/rust-lint-check bin/set-up-for-cocoapods src/rust/scripts/run-tests
# Skip the Python scripts not written with flake8 style. (Try not to add more.)
- run: cd bin && python3 -m flake8 . --exclude measure-cpu.py
- name: Set up mypy types
run: mkdir .mypy_cache/ && python3 -m mypy --install-types --non-interactive bin/logs-notebook/call_log_parser.py --cache-dir=.mypy_cache/
# Only include typed Python scripts here.
- run: python3 -m mypy --python-version 3.8 --strict bin/convert_webrtc_acknowledgments.py bin/fetch-artifact.py bin/logs-notebook/call_log_parser.py bin/logs-notebook/emos.py
- name: Check acknowledgments
run: ./bin/regenerate_acknowledgments.sh && git diff --name-status --exit-code acknowledgments
- name: Clippy
run: cargo clippy --all-targets -- -D warnings
- name: Clippy (with sim)
run: cargo clippy --all-targets --features sim -- -D warnings
- name: Clippy (Android & iOS)
run: cargo clippy --package ringrtc --target aarch64-linux-android --target aarch64-apple-ios -- -D warnings
- name: Clippy (Electron)
run: cargo clippy --package ringrtc --features electron -- -D warnings
- name: Clippy (group_call)
run: cargo clippy --package ringrtc --bin group_call --features native,sim_http -- -D warnings
- name: Clippy (call_link)
run: cargo clippy --package ringrtc --bin call_link --features uuid,sim,sim_http,rand_chacha -- -D warnings
- name: Clippy (call_sim-cli)
run: cargo clippy --package ringrtc --bin call_sim-cli --features call_sim -- -D warnings
- name: Clippy (call_sim)
run: cargo clippy --package call_sim -- -D warnings
- name: Clippy (mrp)
run: cargo clippy --package mrp -- -D warnings
- name: Clippy (protobuf)
run: cargo clippy --package protobuf --features call_sim -- -D warnings
- name: Clippy (signaling_server)
run: cargo clippy -- -D warnings
working-directory: call_sim/docker/signaling_server
- name: Install for node
run: npm ci
working-directory: src/node
- name: Check typescript
run: npm run eslint
working-directory: src/node
- name: Check package.json for prebuildChecksum
run: >-
grep -q '"prebuildChecksum": ""' package.json
working-directory: src/node
- name: Compare package.json and package-lock.json versions
run: >
PKG_OG=$(jq -r .version package.json);
PKG_LOCK=$(jq -r .version package-lock.json);
if [ "$PKG_OG" != "$PKG_LOCK" ]; then
echo "package.json and package-lock.json versions do not match";
exit 1;
fi
working-directory: src/node
tests:
name: Tests
runs-on: ubuntu-22.04
steps:
- name: Install deps
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler libpulse-dev
- uses: actions/checkout@v4
- run: rustup toolchain install $(cat rust-toolchain) --profile minimal
- name: Run rust tests
run: cd src/rust && ./scripts/run-tests
aarch64_cross:
name: Cross compile Linux aarch64 (using prebuilt WebRTC)
runs-on: ubuntu-22.04
steps:
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler crossbuild-essential-arm64 libpulse-dev
- uses: actions/checkout@v4
- run: rustup target add aarch64-unknown-linux-gnu
- run: ./bin/fetch-artifact --platform linux-arm64 --release -o out-arm
- run: CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc TARGET_ARCH=arm64 OUTPUT_DIR=out-arm ./bin/build-electron --ringrtc-only --release
electron:
name: Electron Tests
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, windows-latest, macos-13]
include:
- os: ubuntu-22.04
install-deps: sudo apt-get update && sudo apt-get install -y protobuf-compiler libpulse-dev
test-runner: xvfb-run --auto-servernum
- os: windows-latest
install-deps: choco install protoc cmake
- os: macos-13
install-deps: brew install protobuf coreutils
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash # as opposed to PowerShell
steps:
- name: Install dependencies
run: ${{ matrix.install-deps }}
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: 'src/node/.nvmrc'
- run: rustup toolchain install $(cat rust-toolchain) --profile minimal
- run: bin/fetch-artifact -p desktop
- run: bin/build-electron --release --ringrtc-only
- run: npm ci
working-directory: src/node
- run: npm run build
working-directory: src/node
- run: ${{ matrix.test-runner }} npm test
working-directory: src/node
cargo_build_using_prebuilt:
name: RingRTC as dependency (using Prebuilt WebRTC)
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, macos-13]
include:
- os: ubuntu-22.04
install-deps: sudo apt-get update && sudo apt-get install -y protobuf-compiler libpulse-dev
- os: macos-13
install-deps: brew install protobuf coreutils
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash # as opposed to PowerShell
steps:
- name: Install dependencies
run: ${{ matrix.install-deps }}
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: 'src/node/.nvmrc'
- run: rustup toolchain install $(cat rust-toolchain) --profile minimal
- run: cargo build -p ringrtc --features prebuilt_webrtc
android:
name: Android Build
runs-on: ubuntu-22.04
steps:
- name: Install protoc
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- uses: actions/checkout@v4
- run: rustup toolchain install $(cat rust-toolchain) --profile minimal --target aarch64-linux-android,armv7-linux-androideabi,x86_64-linux-android,i686-linux-android
- name: set up JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- run: bin/fetch-artifact -p android
- run: bin/build-aar --release --ringrtc-only
ios:
name: iOS Tests
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- run: brew install protobuf coreutils # for grealpath
- run: cargo install cbindgen
- run: rustup toolchain install $(cat rust-toolchain) --profile minimal --target x86_64-apple-ios
- run: sudo xcodes select 15.2
- run: bin/fetch-artifact -p ios
- run: bin/build-ios --release --ringrtc-only --host-sim-only
- run: pod install
working-directory: src/ios/SignalRingRTC
# Pick a phone model here that's likely to work on recent Xcodes.
- run: xcodebuild test -workspace SignalRingRTC.xcworkspace -scheme SignalRingRTC -destination 'platform=iOS Simulator,name=iPhone 15'
working-directory: src/ios/SignalRingRTC
env:
TEST_RUNNER_RINGRTC_MAX_LOG_LEVEL: 2 # warnings only