Skip to content

Exposing Wolf events via API #659

Exposing Wolf events via API

Exposing Wolf events via API #659

name: Linux build and test
on:
push:
paths-ignore:
- "docs/**"
- "docker/**"
pull_request:
paths-ignore:
- "docs/**"
- "docker/**"
jobs:
test-arm:
timeout-minutes: 30
runs-on: [ self-hosted, ARM64 ] # self-hosted, using Oracle free tier instance
steps:
- uses: actions/checkout@v4
- name: Prepare environment
run: |
sudo apt-get update -y
sudo apt-get install -y \
g++ \
cmake \
ninja-build \
libboost-locale-dev libboost-thread-dev libboost-filesystem-dev libboost-log-dev libboost-stacktrace-dev libboost-container-dev \
libssl-dev \
libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \
libwayland-dev wayland-protocols libinput-dev libxkbcommon-dev libgbm-dev \
libcurl4-openssl-dev \
libpulse-dev \
libevdev-dev \
libudev-dev \
libdrm-dev \
libpci-dev \
libunwind-dev
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Setup gst-wayland-display
run: |
git clone https://github.com/games-on-whales/gst-wayland-display
cd gst-wayland-display
git checkout 48382dc
cargo install cargo-c
cargo cinstall -p c-bindings --prefix=/usr/local
- name: Archive libgstwaylanddisplay-aarch64
uses: actions/upload-artifact@v4
with:
name: libgstwaylanddisplay-aarch64
path: |
/usr/local/lib/aarch64-linux-gnu/liblibgstwaylanddisplay*
/usr/local/lib/aarch64-linux-gnu/pkgconfig/
/usr/local/include/libgstwaylanddisplay/*
if-no-files-found: error
- name: Configure build
working-directory: ${{runner.workspace}}
run: |
cmake -Bbuild \
-H$GITHUB_WORKSPACE \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_EXTENSIONS=OFF \
-DTEST_VIRTUAL_INPUT=OFF \
-DTEST_DOCKER=ON \
-DTEST_RUST_WAYLAND=ON \
-DTEST_NVIDIA=OFF \
-DTEST_EXCEPTIONS=OFF \
-DTEST_UHID=OFF \
-G Ninja
- name: Build tests + lib
working-directory: ${{runner.workspace}}/build
run: ninja -j $(nproc) wolftests
- name: Run tests
working-directory: ${{runner.workspace}}/build/tests
env:
RUST_BACKTRACE: FULL
RUST_LOG: FATAL
XDG_RUNTIME_DIR: /tmp
HOST_APPS_STATE_FOLDER: ${{runner.workspace}}
run: ./wolftests --reporter JUnit::out=${{runner.workspace}}/report.xml --reporter console::out=-::colour-mode=ansi
- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure() # run this step even if previous step failed
with:
name: aarch64
path: ${{runner.workspace}}/report.xml
reporter: java-junit
# First build the common dependencies: Rust-based libgstwaylanddisplay
build-gst-wayland:
runs-on: ubuntu-24.04
steps:
- name: Prepare environment
# ubuntu-latest breaks without libunwind-dev,
# see: https://github.com/actions/runner-images/issues/6399#issuecomment-1286050292
run: |
sudo apt-get update -y
sudo apt-get install -y libunwind-dev
sudo apt-get install -y \
libwayland-dev libwayland-server0 libinput-dev libxkbcommon-dev libgbm-dev \
libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Setup gst-wayland-display
run: |
git clone https://github.com/games-on-whales/gst-wayland-display
cd gst-wayland-display
git checkout 48382dc
cargo install cargo-c
cargo cinstall -p c-bindings --prefix=/usr/local --destdir=${{runner.workspace}}
- name: Archive libgstwaylanddisplay-x86_64
uses: actions/upload-artifact@v4
with:
name: libgstwaylanddisplay-x86_64
path: |
${{runner.workspace}}/usr/local/lib/x86_64-linux-gnu/liblibgstwaylanddisplay*
${{runner.workspace}}/usr/local/lib/x86_64-linux-gnu/pkgconfig/
${{runner.workspace}}/usr/local/include/libgstwaylanddisplay/*
if-no-files-found: error
test:
runs-on: ubuntu-24.04
needs: build-gst-wayland
strategy:
fail-fast: false
matrix:
cxx:
- g++-12
- clang++-16
build_type: [ Release ]
shared: [ true, false ]
std: [ 20 ]
include:
- cxx: g++-12
other_pkgs: [ g++-12 ]
- cxx: clang++-16
other_pkgs: [ clang-16 ]
steps:
- uses: actions/checkout@v4
- name: Download pre-built libgstwaylanddisplay-x86_64
uses: actions/download-artifact@v4
with:
name: libgstwaylanddisplay-x86_64
path: ${{runner.workspace}}/libgstwaylanddisplay
- name: Move the library in the right place
run: |
ls -R ${{runner.workspace}}/libgstwaylanddisplay
sudo cp -rn ${{runner.workspace}}/libgstwaylanddisplay/* /usr/local/
- name: Prepare environment
# ubuntu-latest breaks without libunwind-dev,
# see: https://github.com/actions/runner-images/issues/6399#issuecomment-1286050292
run: |
sudo apt-get update -y
sudo apt-get install -y libunwind-dev
sudo apt-get install -y \
ninja-build \
libboost-locale-dev libboost-thread-dev libboost-filesystem-dev libboost-log-dev libboost-stacktrace-dev libboost-container-dev \
libssl-dev \
libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \
libwayland-dev libwayland-server0 libinput-dev libxkbcommon-dev libgbm-dev \
libcurl4-openssl-dev \
libpulse-dev \
libevdev-dev \
libudev-dev \
libdrm-dev \
libpci-dev \
libunwind-dev \
${{ join(matrix.other_pkgs, ' ') }}
- name: Configure build
working-directory: ${{runner.workspace}}
env:
CXX: ${{matrix.cxx}}
CXXFLAGS: ${{matrix.cxxflags}}
# Note: $GITHUB_WORKSPACE is distinct from ${{runner.workspace}}.
# This is important
run: |
cmake -Bbuild \
-H$GITHUB_WORKSPACE \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_CXX_STANDARD=${{ matrix.std }} \
-DCMAKE_CXX_EXTENSIONS=OFF \
-DBUILD_SHARED_LIBS=${{ matrix.shared }} \
-DCATCH_DEVELOPMENT_BUILD=ON \
-DTEST_VIRTUAL_INPUT=OFF \
-DTEST_DOCKER=OFF \
-DLINK_RUST_WAYLAND=ON \
-DTEST_RUST_WAYLAND=OFF \
-DTEST_NVIDIA=OFF \
-DTEST_SDL=OFF \
-G Ninja
- name: Build tests + lib
working-directory: ${{runner.workspace}}/build
run: ninja -j $(nproc) wolftests
- name: Run tests
working-directory: ${{runner.workspace}}/build/tests
env:
HOST_APPS_STATE_FOLDER: ${{runner.workspace}}
run: ./wolftests --reporter JUnit::out=${{runner.workspace}}/report.xml --reporter console::out=-::colour-mode=ansi
- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure() # run this step even if previous step failed
with:
name: ${{matrix.cxx}} - STD ${{ matrix.std }} - Shared ${{ matrix.shared }}
path: ${{runner.workspace}}/report.xml
reporter: java-junit