ci: build the daemon for Windows instead of Linux
The Linux job could not get past the linker: libobs-wrapper asks for the OBS 32 scene-item calls and the distro's libobs (30.0.2 on noble, and the OBS PPA publishes no libobs-dev at all) does not have them. That is the state the job has been in, so nothing was building. The daemon ships on Windows, where obs.lib rides with the libobs crate, so the build that matters is the Windows one and cargo-xwin compiles it from the Linux runner with the MSVC runtime and SDK it downloads. The Linux job stays as formatting and clippy over every target: clippy stops at type checking, so it still compiles the cfg(target_os = "linux") paths without linking them. Tests need a machine that can run the exe, so they stay local for now.
This commit is contained in:
1 parent
18a952d4c1
commit
6a604fe4d8
1 file changed
+37
-15
@@ -13,10 +13,10 @@ env:
|
|||||||
RUST_BACKTRACE: 1
|
RUST_BACKTRACE: 1
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# Make sure that the program correctly builds,
|
# Type-checks the daemon on Linux: formatting, and clippy over every target, which compiles
|
||||||
# passes format and lints, as well as tests
|
# the cfg(target_os = "linux") paths without linking them. Linking is the Windows job's.
|
||||||
build-test:
|
check:
|
||||||
name: Build, check and test
|
name: Check and lint (Linux)
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
@@ -34,21 +34,43 @@ jobs:
|
|||||||
run: cargo fmt --check
|
run: cargo fmt --check
|
||||||
|
|
||||||
- name: Install system build dependencies
|
- name: Install system build dependencies
|
||||||
|
# pkg-config finds libobs for its build script; nothing is linked here, so the distro's
|
||||||
|
# version is enough even though the Windows build links a newer obs.lib.
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y pkg-config libglib2.0-dev libobs-dev libc6-dev clang libwayland-client0 libwayland-dev
|
sudo apt-get install -y pkg-config libglib2.0-dev libobs-dev libc6-dev clang libwayland-dev
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: cargo build
|
|
||||||
env:
|
|
||||||
RUSTFLAGS: -Dwarnings
|
|
||||||
|
|
||||||
- name: Lint
|
- name: Lint
|
||||||
run: cargo clippy --all-targets --all-features
|
run: cargo clippy --all-targets --all-features
|
||||||
|
|
||||||
- name: Run tests with verbose logging (timeout 30min)
|
# The daemon ships on Windows and links Windows' obs.lib, so that is the build worth checking.
|
||||||
run: timeout 30m cargo test -- --nocapture
|
# It cross-compiles from the Linux runner: obs.lib rides with the libobs crate, and cargo-xwin
|
||||||
env:
|
# brings the MSVC runtime and the Windows SDK. Tests need a machine that can run the exe, so
|
||||||
RUST_LOG: debug
|
# they stay local: `cargo test` in record-daemon on Windows.
|
||||||
|
build:
|
||||||
|
name: Build (Windows x64)
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
working-directory: record-daemon
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
# TODO: Add windows native builds
|
- name: Install Rust toolchain
|
||||||
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
with:
|
||||||
|
targets: x86_64-pc-windows-msvc
|
||||||
|
|
||||||
|
- name: Install the cross linker
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y clang lld llvm
|
||||||
|
|
||||||
|
- name: Install cargo-xwin
|
||||||
|
run: cargo install cargo-xwin --locked
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: cargo xwin build --target x86_64-pc-windows-msvc
|
||||||
|
env:
|
||||||
|
RUSTFLAGS: -Dwarnings
|
||||||
Reference in new issue
Block a user