From 9c2220d264eec4a2e91f469b25f56fdcda71bc2c Mon Sep 17 00:00:00 2001 From: Valentin Haudiquet Date: Sat, 21 Mar 2026 00:57:23 +0100 Subject: [PATCH] ci: add ci workflow for record-daemon --- .github/workflows/record-daemon.yml | 90 +++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 .github/workflows/record-daemon.yml diff --git a/.github/workflows/record-daemon.yml b/.github/workflows/record-daemon.yml new file mode 100644 index 0000000..b23116b --- /dev/null +++ b/.github/workflows/record-daemon.yml @@ -0,0 +1,90 @@ +name: record-daemon + +on: + push: + branches: + - main + pull_request: + branches: + - main + +env: + CARGO_TERM_COLOR: always + RUST_BACKTRACE: 1 + +jobs: + # Make sure that the program correctly builds, + # passes format and lints, as well as tests + build-test: + name: Format Check + runs-on: ubuntu-latest + defaults: + run: + working-directory: record-daemon + steps: + - name: Checkout repository + uses: actions/checkout@v6 + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + with: + components: rustfmt, clippy + + - name: Check format + run: cargo fmt --check + + - name: Lint + run: cargo clippy --all-targets --all-features + + - name: Build + run: cargo build + env: + RUSTFLAGS: -Dwarnings + + - name: Run tests with verbose logging (timeout 30min) + run: timeout 30m cargo test -- --nocapture + env: + RUST_LOG: debug + + # Windows release build using cargo-xwin (cross-compile from Linux) + build-windows-xwin: + name: Build Windows (xwin) + runs-on: ubuntu-latest + needs: [build-test] + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + with: + targets: x86_64-pc-windows-msvc + + - name: Install cargo-xwin + run: cargo install cargo-xwin + + - name: Build release for Windows + run: cargo xwin build --release --target x86_64-pc-windows-msvc + working-directory: record-daemon + + - name: Prepare release artifact + run: | + mkdir -p release + # Copy the executable + cp record-daemon/target/x86_64-pc-windows-msvc/release/record-daemon.exe release/ + # Copy all DLL files from the release directory (libobs and dependencies) + cp record-daemon/target/x86_64-pc-windows-msvc/release/*.dll release/ 2>/dev/null || true + # Copy documentation + cp record-daemon/README.md release/ 2>/dev/null || true + + - name: Create zip archive + run: | + cd release + zip -r ../record-daemon-windows-x86_64.zip . + + - name: Upload Windows artifact + uses: actions/upload-artifact@v4 + with: + name: record-daemon-windows-x86_64.zip + path: record-daemon-windows-x86_64.zip + retention-days: 30