-
Notifications
You must be signed in to change notification settings - Fork 0
128 lines (123 loc) · 4.94 KB
/
Copy pathci.yml
File metadata and controls
128 lines (123 loc) · 4.94 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
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
name: CI
on:
push:
branches: [main]
pull_request:
jobs:
core:
name: core-only (no picoquic)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install build tools
run: sudo apt-get update && sudo apt-get install -y cmake g++ ninja-build
- name: Configure (core only)
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug
-DROQR_BUILD_QUIC=OFF -DROQR_BUILD_RTMP=ON
-DROQR_BUILD_EXAMPLES=OFF -DROQR_BUILD_TESTS=ON
- name: Build
run: cmake --build build --parallel
- name: Test
run: ctest --test-dir build --output-on-failure
full:
name: full (${{ matrix.cc }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- { cc: gcc, cxx: g++ }
- { cc: clang, cxx: clang++ }
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y
cmake g++ clang ninja-build libssl-dev ffmpeg
- name: Build picoquic deps
run: eval "$(scripts/setup_picoquic_deps.sh)"; echo "$ROQR_PICOQUIC_SOURCE_DIR"
- name: Configure
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
run: |
eval "$(scripts/setup_picoquic_deps.sh)"
cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug \
-DROQR_BUILD_QUIC=ON -DROQR_BUILD_RTMP=ON \
-DROQR_BUILD_TOOLS=ON -DROQR_BUILD_EXAMPLES=ON \
-DROQR_BUILD_TESTS=ON
- name: Build
run: cmake --build build --parallel
- name: Test
run: ctest --test-dir build --output-on-failure
tsan:
name: thread-sanitizer (clang)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y
cmake clang ninja-build libssl-dev ffmpeg
- name: Build picoquic deps
run: eval "$(scripts/setup_picoquic_deps.sh)"
- name: Configure (TSAN; ROQR targets instrumented, picoquic is not)
env:
CC: clang
CXX: clang++
run: |
eval "$(scripts/setup_picoquic_deps.sh)"
cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug \
-DROQR_SANITIZE=thread \
-DROQR_BUILD_QUIC=ON -DROQR_BUILD_RTMP=ON \
-DROQR_BUILD_TOOLS=ON -DROQR_BUILD_EXAMPLES=ON \
-DROQR_BUILD_TESTS=ON -DROQR_BUILD_JNI=OFF
- name: Build
run: cmake --build build --parallel
# halt_on_error=0 lets a single test report every race it hits; TSAN still
# exits non-zero if any (unsuppressed) race is found, failing the job. The
# suppressions file covers only picoquic's internal wake-up-pipe fd races
# (see cmake/tsan.supp); races in ROQR code are unsuppressed and fail CI.
- name: Test (TSAN)
env:
TSAN_OPTIONS: "halt_on_error=0 history_size=7 second_deadlock_stack=1 suppressions=${{ github.workspace }}/cmake/tsan.supp"
run: ctest --test-dir build --output-on-failure --timeout 300
rust-example:
name: rust ffi example
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y
cmake g++ ninja-build libssl-dev openssl
- name: Build picoquic deps
run: eval "$(scripts/setup_picoquic_deps.sh)"
# Build only what the example needs: the FFI shared library and the relay.
- name: Build libroqr-ffi and roqr-relayd
run: |
eval "$(scripts/setup_picoquic_deps.sh)"
cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug \
-DROQR_BUILD_QUIC=ON -DROQR_BUILD_RTMP=ON -DROQR_BUILD_TOOLS=ON \
-DROQR_BUILD_FFI=ON -DROQR_BUILD_EXAMPLES=OFF \
-DROQR_BUILD_TESTS=OFF -DROQR_BUILD_JNI=OFF
cmake --build build --target roqr-ffi roqr-relayd --parallel
# ubuntu-latest ships a stable Rust toolchain; no install step needed.
- name: Build the Rust example
env:
ROQR_FFI_LIB_DIR: ${{ github.workspace }}/build/ffi
RUSTFLAGS: "-D warnings"
run: cargo build --manifest-path examples/rust/Cargo.toml
# End-to-end: the example connects to a relay in echo mode and must get
# every frame back. build.rs baked an rpath to ROQR_FFI_LIB_DIR, so the
# binary finds libroqr-ffi.so without LD_LIBRARY_PATH.
- name: Echo round-trip smoke test
run: |
openssl req -x509 -newkey ec -pkeyopt ec_paramgen_curve:prime256v1 \
-keyout key.pem -out cert.pem -days 365 -nodes -subj "/CN=localhost"
./build/bin/roqr-relayd --cert cert.pem --key key.pem --port 4443 --mode echo &
relay_pid=$!
trap 'kill "$relay_pid" 2>/dev/null || true' EXIT
sleep 2
set +e
examples/rust/target/debug/roqr-rust-client 127.0.0.1 4443
rc=$?
set -e
exit $rc