Skip to content

Commit

Permalink
TRY CI
Browse files Browse the repository at this point in the history
  • Loading branch information
joaoantoniocardoso committed Sep 30, 2024
1 parent 99fd8db commit 6655070
Show file tree
Hide file tree
Showing 2 changed files with 107 additions and 6 deletions.
101 changes: 101 additions & 0 deletions .github/workflows/test_with_v4l2loopback.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
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"
export GST_DEBUG=*:3
timeout 300 cargo test --test v4l2_latency_and_jitter --verbose --locked
12 changes: 6 additions & 6 deletions tests/v4l2_latency_and_jitter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -568,23 +568,23 @@ async fn main() {
let buffers = 100;

let test_cases = [
(VideoEncodeType::H264, format!("udp://{address}:5600"), 30.),
(VideoEncodeType::Mjpg, format!("udp://{address}:5600"), 30.),
(VideoEncodeType::Yuyv, format!("udp://{address}:5600"), 30.),
(VideoEncodeType::H264, format!("udp://{address}:5600"), 60.),
(VideoEncodeType::Mjpg, format!("udp://{address}:5600"), 60.),
(VideoEncodeType::Yuyv, format!("udp://{address}:5600"), 60.),
(
VideoEncodeType::H264,
format!("rtsp://{address}:8554/test"),
30.,
60.,
),
(
VideoEncodeType::Mjpg,
format!("rtsp://{address}:8554/test"),
30.,
60.,
),
(
VideoEncodeType::Yuyv,
format!("rtsp://{address}:8554/test"),
30.,
60.,
),
];

Expand Down

0 comments on commit 6655070

Please sign in to comment.