The MinGW path kept fighting the environment (the GitHub image's MSVC INCLUDE/LIB poison the GNU compiles; ocio-sys' fork then dragged the MSVC-only headers into g++ and died on vcruntime.h). The Windows jobs on both workflows now: - run on warp-windows-2025-vs2026-x64-16x (preinstalled VS 2026) with the stable MSVC Rust toolchain; - install dependencies through vcpkg MANIFEST mode: vcpkg.json at the repo root carries FFmpeg with every free codec + hwaccel (mirroring build-ffmpeg.sh's configure), pkgconf and librsvg; the vcpkg_installed tree plus the binary-cache archives are cached on the manifest hash with save-always; - build OCIO bundled (ocio-sys' vendored sources are what MSVC wants — the MSYS2 package was the workaround, not the preference), so OCIO_RS_NO_MSVC_INCLUDES is gone; - ship the vcpkg runtime DLLs next to the binaries in the NSIS installer with a static-CRT release build (no vcruntime DLLs), replacing the ntldd-based MSYS2 bundling. FFmpeg version pinning via builtin-baseline is a documented follow-up: the Configure step logs vcpkg list so the first green run reports the resolved versions. docs/build.md keeps the MSYS2 flow as the local alternative and points at the CI path.
376 lines
16 KiB
YAML
376 lines
16 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
|
|
concurrency:
|
|
group: ci-${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
linux:
|
|
name: Build & test (Linux)
|
|
runs-on: warp-ubuntu-latest-x64-8x
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
# gpui/ is a git submodule; its crates are workspace members of
|
|
# their own repo and build as path dependencies of oakapp.
|
|
submodules: true
|
|
|
|
- name: Install Rust (stable)
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
# ------------------------------------------------------------------
|
|
# System dependencies
|
|
# ------------------------------------------------------------------
|
|
- name: Install system dependencies
|
|
run: |
|
|
# Codec/filter libraries for the ffmpeg-sys-next build feature
|
|
# (see tooling/install-deps.sh).
|
|
tooling/install-deps.sh
|
|
# cmake/make for the vendored OpenColorIO build (ocio-sys
|
|
# `bundled`; Ubuntu's libopencolorio-dev is 2.1, older than the
|
|
# bridge's API floor) plus the headless test infra gpui needs:
|
|
# X11, software Mesa Vulkan (lavapipe) and xvfb.
|
|
sudo apt-get install -y \
|
|
cmake \
|
|
libpipewire-0.3-dev libspa-0.2-dev libjack-jackd2-dev \
|
|
libasound2-dev libpulse-dev libsndfile1-dev \
|
|
libgl1-mesa-dev libgl1-mesa-dri mesa-vulkan-drivers \
|
|
libvulkan-dev libxkbcommon-dev libxkbcommon-x11-dev xvfb build-essential clang libclang-dev
|
|
|
|
# ------------------------------------------------------------------
|
|
# Build environment
|
|
# ------------------------------------------------------------------
|
|
# ocio-sys builds a stub bridge unless these are set; the oak-core
|
|
# ocioutils tests need the real library.
|
|
# tooling/ocio-env.sh: vendored static OCIO (the [patch.crates-io]
|
|
# ocio-sys tracks shaloong/ocio-rs main, whose vendored sources build
|
|
# on GCC >= 16).
|
|
- name: Configure build environment
|
|
run: |
|
|
bash tooling/ocio-env.sh >> "$GITHUB_ENV"
|
|
echo "FFMPEG_DIR=.cache/ffmpeg" >> "$GITHUB_ENV"
|
|
|
|
# ------------------------------------------------------------------
|
|
# Caches
|
|
# ------------------------------------------------------------------
|
|
# Covers the whole target/ dir plus ~/.cargo; shared across branches
|
|
# of the same OS.
|
|
- name: Cache cargo artifacts
|
|
uses: Swatinem/rust-cache@v2
|
|
with:
|
|
shared-key: oak-ci-linux
|
|
cache-on-failure: true
|
|
|
|
# The project FFmpeg (release/8.0, static, all free codecs + hwaccel)
|
|
# is built by tooling/ffmpeg/build-ffmpeg.sh — 10-20 min on a cold
|
|
# cache. It does not depend on the Rust toolchain, so key it on the
|
|
# script itself and keep it out of rust-cache.
|
|
- name: Cache project FFmpeg
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: .cache/ffmpeg
|
|
key: ffmpeg-${{ runner.os }}-${{ hashFiles('tooling/ffmpeg/build-ffmpeg.sh') }}
|
|
save-always: true
|
|
|
|
# ------------------------------------------------------------------
|
|
# Project FFmpeg (script + FFMPEG_DIR; see docs/build.md)
|
|
# ------------------------------------------------------------------
|
|
- name: Build project FFmpeg
|
|
run: |
|
|
tooling/ffmpeg/build-ffmpeg.sh
|
|
echo "FFMPEG_DIR=$PWD/.cache/ffmpeg" >> "$GITHUB_ENV"
|
|
|
|
# ------------------------------------------------------------------
|
|
# Build & test
|
|
# ------------------------------------------------------------------
|
|
# `cargo check` (not build): the Test step links the test binaries
|
|
# anyway, and a full build would codegen every workspace crate twice
|
|
# (once without and once with cfg(test)).
|
|
- name: Build
|
|
run: cargo check --workspace --locked
|
|
|
|
# xvfb + 24-bit screen: the gpui #[gpui::test] tests open real windows
|
|
# and render through wgpu on Mesa's software Vulkan (lavapipe).
|
|
# The watchdog bounds the step: a deadlocked test produces no output
|
|
# and no failure, so after 1800 s it dumps every hung process's
|
|
# thread stacks and kills the suite.
|
|
- name: Test
|
|
run: |
|
|
sudo apt-get install -y gdb
|
|
run_suite() {
|
|
xvfb-run -a -s "-screen 0 1920x1080x24" cargo test --workspace --locked &
|
|
TEST_PID=$!
|
|
# The watchdog inherits the step's stdout/stderr; detach it so
|
|
# it cannot keep the runner's I/O pipes open after the step
|
|
# ends ("WaitDelay expired before I/O complete" otherwise).
|
|
(
|
|
sleep 1800
|
|
echo "::warning::test suite exceeded 1800s; dumping hung-process stacks"
|
|
for p in $(pgrep -f 'target/debug/deps/|target/debug/oak-worker'); do
|
|
echo "===== thread stacks of pid $p ($(readlink /proc/$p/exe 2>/dev/null)) ====="
|
|
sudo gdb -batch -ex 'thread apply all bt' -p "$p" || true
|
|
done
|
|
pkill -9 -f 'target/debug/deps/' || true
|
|
pkill -9 -f 'target/debug/oak-worker' || true
|
|
) >/dev/null 2>&1 &
|
|
WATCHDOG_PID=$!
|
|
wait $TEST_PID
|
|
rc=$?
|
|
kill $WATCHDOG_PID 2>/dev/null || true
|
|
# Reap the watchdog so no child holds the step's pipes.
|
|
wait $WATCHDOG_PID 2>/dev/null || true
|
|
return $rc
|
|
}
|
|
# Retry once (same policy as the Windows job): worker-pool
|
|
# startup under full-suite parallelism has flaked once
|
|
# (full_res_worker_outlives_a_dropped_project: the render
|
|
# manager's process dispatcher failed to start while every other
|
|
# test passed). A real regression fails both passes.
|
|
if ! run_suite; then
|
|
echo "first pass failed; retrying once for worker-pool flakes"
|
|
run_suite
|
|
fi
|
|
|
|
# A crashing (SIGSEGV) test gives no Rust backtrace; rerun the
|
|
# crashing test binaries under gdb to capture the native stack.
|
|
# `--args` is required — plain `--` makes gdb treat the test args as
|
|
# a core file. The extra probes target loader-stage crashes (the
|
|
# copier_test SIGSEGV happens inside ld.so's dl_main): si_addr/si_code
|
|
# pin down the fault type, the dynsym dump exposes symbols the
|
|
# executable exports for interposition, strace shows the last loader
|
|
# syscalls, and valgrind catches a corrupting static initializer.
|
|
- name: Backtrace on test failure
|
|
if: failure()
|
|
run: |
|
|
sudo apt-get install -y gdb strace valgrind
|
|
for name in node_e2e_test suites_test copier_test; do
|
|
BIN=$(ls -t target/debug/deps/$name-* | grep -v '\.d$' | head -1)
|
|
[ -n "$BIN" ] || continue
|
|
echo "===== $BIN ====="
|
|
file "$BIN" || true
|
|
echo "--- exported defined dynsyms:"
|
|
readelf --dyn-syms -W "$BIN" 2>/dev/null | grep -v ' UND ' | tail -n +4 | head -30 || true
|
|
echo "--- strace tail:"
|
|
strace -f "$BIN" --list 2>&1 | tail -15 || true
|
|
echo "--- valgrind tail:"
|
|
valgrind -q "$BIN" --list 2>&1 | tail -25 || true
|
|
echo "--- gdb:"
|
|
xvfb-run -a gdb -batch \
|
|
-ex run \
|
|
-ex 'bt' \
|
|
-ex 'p $_siginfo.si_code' \
|
|
-ex 'p/x $_siginfo._sifields._sigfault.si_addr' \
|
|
-ex 'x/6i $rip' \
|
|
--args "$BIN" --nocapture || true
|
|
done
|
|
|
|
# ------------------------------------------------------------------
|
|
# OFX plugin discovery end-to-end
|
|
# ------------------------------------------------------------------
|
|
# Build a minimal but real OFX plugin into a .ofx.bundle, point
|
|
# OFX_PLUGIN_PATH at it and let the scan_probe example run the full
|
|
# host path (directory scan -> dlopen -> setHost -> load -> describe
|
|
# -> register). The assertion is the plugin's registration line; CI
|
|
# machines have no system-wide OFX plugins, so the fixture is the
|
|
# only discovery.
|
|
- name: Build OFX fixture plugin
|
|
run: crates/oak-plugin/tests/fixtures/build_fixture.sh .cache/ofx-fixture
|
|
|
|
- name: Probe OFX plugin discovery
|
|
run: |
|
|
OFX_PLUGIN_PATH="$PWD/.cache/ofx-fixture" \
|
|
cargo run --locked -p oak-plugin --example scan_probe > probe.log 2>&1
|
|
grep -q 'type_id=rs.oak.CiTestPlugin' probe.log
|
|
# A project carrying a plugin node must survive save/load (the
|
|
# serializer resolves plugin types via the dynamic factory).
|
|
OAK_OFX_FIXTURE_DIR="$PWD/.cache/ofx-fixture" \
|
|
cargo test --locked -p oak-plugin --test ofx_roundtrip
|
|
|
|
windows:
|
|
name: Build & test (Windows)
|
|
runs-on: warp-windows-2025-vs2026-x64-16x
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
# gpui/ is a git submodule; its crates are workspace members of
|
|
# their own repo and build as path dependencies of oakapp.
|
|
submodules: true
|
|
|
|
- name: Install Rust (stable, MSVC)
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
# The Windows build is MSVC-ABI (the runner carries VS 2026):
|
|
# vcpkg's FFmpeg and the vendored OCIO build both want it.
|
|
toolchain: stable-x86_64-pc-windows-msvc
|
|
|
|
# ------------------------------------------------------------------
|
|
# vcpkg (manifest mode) + caches
|
|
# ------------------------------------------------------------------
|
|
# vcpkg.json at the repo root pins the dependency set (FFmpeg with
|
|
# every free codec + hwaccel, pkgconf, librsvg); the resolved tree
|
|
# lands in vcpkg_installed/ and is keyed on the manifest. The
|
|
# binary-cache archives dir makes a manifest bump rebuild cheap.
|
|
- name: Cache vcpkg artifacts
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
vcpkg_installed
|
|
~/AppData/Local/vcpkg/archives
|
|
key: vcpkg-${{ runner.os }}-${{ hashFiles('vcpkg.json') }}
|
|
save-always: true
|
|
|
|
- name: Install dependencies (vcpkg manifest)
|
|
run: vcpkg install --triplet x64-windows
|
|
|
|
# ------------------------------------------------------------------
|
|
# Build environment
|
|
# ------------------------------------------------------------------
|
|
- name: Configure build environment
|
|
run: |
|
|
$prefix = "$env:GITHUB_WORKSPACE\vcpkg_installed\x64-windows"
|
|
"FFMPEG_DIR=$prefix" >> $env:GITHUB_ENV
|
|
"PKG_CONFIG_PATH=$prefix\lib\pkgconfig" >> $env:GITHUB_ENV
|
|
"$prefix\tools\pkgconf" >> $env:GITHUB_PATH
|
|
# Bundled OCIO: ocio-sys' vendored sources build with the MSVC
|
|
# toolchain (what they need — the MSYS2 package was the
|
|
# workaround, not the preference), so no OCIO_INSTALL_DIR and
|
|
# no OCIO_RS_NO_MSVC_INCLUDES anywhere.
|
|
"OCIO_RS_ENABLE_REAL=1" >> $env:GITHUB_ENV
|
|
"OCIO_RS_LINK=static" >> $env:GITHUB_ENV
|
|
# Record the resolved versions in the build log: pinning them
|
|
# with builtin-baseline in vcpkg.json is a follow-up.
|
|
vcpkg list
|
|
|
|
# Covers the whole target/ dir plus ~/.cargo; shared across branches
|
|
# of the same OS.
|
|
- name: Cache cargo artifacts
|
|
uses: Swatinem/rust-cache@v2
|
|
with:
|
|
shared-key: oak-ci-windows
|
|
cache-on-failure: true
|
|
|
|
# ------------------------------------------------------------------
|
|
# Build & test
|
|
# ------------------------------------------------------------------
|
|
# `cargo check` (not build): the Test step links the test binaries
|
|
# anyway, and a full build would codegen every workspace crate twice
|
|
# (once without and once with cfg(test)).
|
|
- name: Build
|
|
run: cargo check --workspace --locked
|
|
|
|
- name: Test
|
|
run: |
|
|
cargo test --workspace --locked
|
|
if ($LASTEXITCODE -ne 0) {
|
|
# Retry once: a few gpui keystroke tests flake on Windows CI —
|
|
# a synthetic keystroke is occasionally never delivered (the
|
|
# undo/redo pair and a plain 's' toggle both failed once,
|
|
# each identically to its pass state). A real regression
|
|
# fails both passes.
|
|
Write-Host "first pass failed; retrying once for gpui keystroke flakes"
|
|
cargo test --workspace --locked
|
|
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
|
|
}
|
|
|
|
macos:
|
|
name: Build & test (macOS)
|
|
runs-on: warp-macos-26-arm64-6x
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
# gpui/ is a git submodule; its crates are workspace members of
|
|
# their own repo and build as path dependencies of oakapp.
|
|
submodules: true
|
|
|
|
- name: Install Rust (stable)
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
# ------------------------------------------------------------------
|
|
# System dependencies
|
|
# ------------------------------------------------------------------
|
|
- name: Install system dependencies
|
|
run: |
|
|
tooling/install-deps.sh
|
|
brew install cmake
|
|
|
|
# ------------------------------------------------------------------
|
|
# Build environment
|
|
# ------------------------------------------------------------------
|
|
- name: Configure build environment
|
|
run: |
|
|
# Vendored static OCIO (same as every non-Windows platform via
|
|
# tooling/ocio-env.sh); no OCIO_INSTALL_DIR override.
|
|
bash tooling/ocio-env.sh >> "$GITHUB_ENV"
|
|
# Homebrew quirks: lame.pc / snappy / libopenjp2.pc live off the
|
|
# default pkg-config search paths (see docs/build.md).
|
|
{
|
|
echo "CFLAGS=-I/opt/homebrew/include"
|
|
echo "LDFLAGS=-L/opt/homebrew/lib"
|
|
echo "PKG_CONFIG_PATH=/opt/homebrew/lib/pkgconfig/openjpeg"
|
|
} >> "$GITHUB_ENV"
|
|
echo "FFMPEG_DIR=.cache/ffmpeg" >> "$GITHUB_ENV"
|
|
|
|
# ------------------------------------------------------------------
|
|
# Caches
|
|
# ------------------------------------------------------------------
|
|
# Covers the whole target/ dir plus ~/.cargo; shared across branches
|
|
# of the same OS.
|
|
- name: Cache cargo artifacts
|
|
uses: Swatinem/rust-cache@v2
|
|
with:
|
|
shared-key: oak-ci-macos
|
|
cache-on-failure: true
|
|
|
|
# The project FFmpeg (release/8.0, static, all free codecs + hwaccel)
|
|
# is built by tooling/ffmpeg/build-ffmpeg.sh — 10-20 min on a cold
|
|
# cache. It does not depend on the Rust toolchain, so key it on the
|
|
# script itself and keep it out of rust-cache.
|
|
- name: Cache project FFmpeg
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: .cache/ffmpeg
|
|
key: ffmpeg-${{ runner.os }}-${{ hashFiles('tooling/ffmpeg/build-ffmpeg.sh') }}
|
|
|
|
# ------------------------------------------------------------------
|
|
# Project FFmpeg (script + FFMPEG_DIR; see docs/build.md)
|
|
# ------------------------------------------------------------------
|
|
- name: Build project FFmpeg
|
|
run: |
|
|
tooling/ffmpeg/build-ffmpeg.sh
|
|
echo "FFMPEG_DIR=$PWD/.cache/ffmpeg" >> "$GITHUB_ENV"
|
|
|
|
# ------------------------------------------------------------------
|
|
# Build & test
|
|
# ------------------------------------------------------------------
|
|
# `cargo check` (not build): the Test step links the test binaries
|
|
# anyway, and a full build would codegen every workspace crate twice
|
|
# (once without and once with cfg(test)).
|
|
- name: Build
|
|
run: cargo check --workspace --locked
|
|
|
|
# The runner's GUI session doubles as the display for the gpui
|
|
# #[gpui::test] windows; wgpu renders through Metal.
|
|
- name: Test
|
|
run: |
|
|
# Retry once (same policy as the other platforms): worker-pool
|
|
# startup under full-suite parallelism has flaked on Linux. A
|
|
# real regression fails both passes.
|
|
if ! cargo test --workspace --locked; then
|
|
echo "first pass failed; retrying once for worker-pool flakes"
|
|
cargo test --workspace --locked
|
|
fi
|