ci: add ci workflow for record-daemon
Some checks failed
record-daemon / Format Check (push) Failing after 37s
record-daemon / Build Windows (xwin) (push) Has been skipped

This commit is contained in:
2026-03-21 00:57:23 +01:00
parent 8c83404191
commit 9c2220d264

90
.github/workflows/record-daemon.yml vendored Normal file
View File

@@ -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