From dd7e1dc2080912b426ac12c65434c2e7e062478b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Mon, 30 Sep 2024 22:00:04 -0300 Subject: [PATCH] .github: Add latency and jitter v4l2loopback CI tests --- .github/workflows/test_with_v4l2loopback.yml | 100 +++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 .github/workflows/test_with_v4l2loopback.yml diff --git a/.github/workflows/test_with_v4l2loopback.yml b/.github/workflows/test_with_v4l2loopback.yml new file mode 100644 index 00000000..c342ca7f --- /dev/null +++ b/.github/workflows/test_with_v4l2loopback.yml @@ -0,0 +1,100 @@ +name: Test with v4l2loopback + +on: [push, pull_request] + +jobs: + build: + runs-on: rpi3 + + steps: + - name: Check if /dev/video42 exists + run: | + if [ ! -e /dev/video42 ]; then + echo "::error::Error: /dev/video42 does not exist." + exit 1 + fi + + - name: Install build dependencies + uses: awalsh128/cache-apt-pkgs-action@v1 + with: + packages: | + libunwind-dev \ + libclang-dev \ + pkg-config \ + build-essential \ + curl \ + wget \ + gnupg \ + git \ + ca-certificates \ + libgit2-dev \ + 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: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Install build dependencies - Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + # cache: 'yarn' + # cache-dependency-path: 'src/lib/stream/webrtc/frontend' + + - name: Install build dependencies - Install Yarn + run: npm install --global yarn + + - name: Set directory to safe for git + # Note: Required by vergen (https://crates.io/crates/vergen) + run: git config --global --add safe.directory $GITHUB_WORKSPACE + + - name: Use cached dependencies + uses: Swatinem/rust-cache@v2 + with: + key: "${{ hashFiles('**/Cargo.lock') }}" + shared-key: "shared" + + - name: Install build dependencies - Rustup + run: | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain stable -y + echo "$HOME/.cargo/bin" >> $GITHUB_PATH + + - uses: oven-sh/setup-bun@v2 + with: + bun-version: latest + + - name: Build tests + run: cargo test --no-run --verbose --locked -j 2 + + - name: Install runtime dependencies + uses: awalsh128/cache-apt-pkgs-action@v1 + with: + packages: | + gstreamer1.0-libav \ + gstreamer1.0-nice \ + gstreamer1.0-plugins-ugly \ + gstreamer1.0-tools \ + gstreamer1.0-x \ + libgstreamer-plugins-bad1.0-0 \ + libgstreamer-plugins-base1.0-0 \ + libgstreamer-plugins-good1.0-0 \ + libgstreamer1.0-0 \ + libgstrtspserver-1.0-0 + + - name: Install runtime dependencies - qrtimestamp + run: | + wget -q https://github.com/patrickelectric/qrtimestamp-gst/releases/download/0.1.0/libgstqrtimestamp-aarch64.so.tar -O - | tar -x + + - name: Run tests + run: | + export GST_PLUGIN_PATH="$PWD:$GST_PLUGIN_PATH" + timeout 300 cargo test --test v4l2_latency_and_jitter --verbose --locked