Improve webrtc test #84
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test webrtc thread leak | |
on: [push, pull_request] | |
jobs: | |
test-webrtc-thread-leak: | |
runs-on: ubuntu-22.04 | |
# container: ubuntu:24.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install build dependencies | |
run: | | |
apt update | |
apt install -y --no-install-recommends \ | |
libunwind-dev \ | |
libclang-dev \ | |
libssl-dev \ | |
pkg-config \ | |
build-essential \ | |
curl \ | |
wget \ | |
gnupg \ | |
ca-certificates \ | |
libgit2-dev \ | |
rustup \ | |
libmount-dev \ | |
libsepol-dev \ | |
libselinux1-dev \ | |
libglib2.0-dev \ | |
libgudev-1.0-dev \ | |
libgstreamer1.0-dev \ | |
libgstreamer-plugins-base1.0-dev \ | |
libgstreamer-plugins-bad1.0-dev \ | |
libgstrtspserver-1.0-dev | |
- name: Install build dependencies - Node and Yarn | |
run: | | |
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key \ | |
| gpg --dearmor -o /usr/share/keyrings/nodesource.gpg | |
echo "deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" \ | |
| tee /etc/apt/sources.list.d/nodesource.list | |
curl -fsSL https://dl.yarnpkg.com/debian/pubkey.gpg \ | |
| gpg --dearmor -o /usr/share/keyrings/yarnkey.gpg | |
echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" \ | |
| tee /etc/apt/sources.list.d/yarn.list | |
apt update -y | |
apt install -y --no-install-recommends \ | |
nodejs \ | |
yarn | |
- name: Get stable Rust | |
run: rustup default stable | |
- name: Build | |
run: RUST_BACKTRACE=1 cargo build --verbose | |
- name: Install runtime dependencies | |
run: | | |
apt update | |
apt install -y --no-install-recommends \ | |
gstreamer1.0-tools \ | |
gstreamer1.0-x \ | |
gstreamer1.0-nice \ | |
gstreamer1.0-libav \ | |
gstreamer1.0-plugins-ugly | |
- name: Get libssl.so.1.1 | |
# Note: if the link breaks, find it here: https://packages.ubuntu.com/focal/amd64/libssl1.1/download | |
run: | | |
wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.22_amd64.deb -O /tmp/openssl.deb | |
dpkg -i /tmp/openssl.deb | |
- name: Install Google Chrome and Chromedriver | |
# Get the json API from https://github.com/GoogleChromeLabs/chrome-for-testing?tab=readme-ov-file#json-api-endpoints | |
run: | | |
apt install -y --no-install-recommends jq unzip | |
wget --no-check-certificate https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json -O /tmp/downloads.json | |
chrome_url=$(jq -r '."channels"."Stable"."downloads"."chrome"[] | select(."platform" == "linux64") | ."url"' /tmp/downloads.json) | |
wget --no-check-certificate $chrome_url -O /tmp/chrome.zip | |
unzip /tmp/chrome.zip -d /tmp/ | |
mkdir -p /opt/google | |
mv -f /tmp/chrome-linux64 /opt/google/chrome | |
ln -s /opt/google/chrome/chrome /usr/bin/chrome | |
chromedriver_url=$(jq -r '."channels"."Stable"."downloads"."chromedriver"[] | select(."platform" == "linux64") | ."url"' /tmp/downloads.json) | |
wget --no-check-certificate $chromedriver_url -O /tmp/chromedriver.zip | |
unzip /tmp/chromedriver.zip -d /tmp/ | |
mv -f /tmp/chromedriver-linux64 /opt/google/chromedriver | |
ln -s /opt/google/chromedriver/chromedriver /usr/bin/chromedriver | |
- name: Run test | |
run: | | |
RUST_BACKTRACE=1 timeout 300 cargo run --verbose -- \ | |
--mavlink udpin:0.0.0.0:6666 --verbose --default-settings WebRTCTest --enable-webrtc-task-test 6666 || echo "Test failed" && exit 1 |