gitea: move workflows to .gitea, disable caches; settle the keystroke flake
Gitea prep: .github becomes .gitea (the act runner looks there), and every actions/cache + Swatinem/rust-cache step is commented out until the self-hosted instance has a cache provisioned. The remaining marketplace actions (checkout/upload-artifact are act-compatible; msys2/setup-msys2, dtolnay/rust-toolchain and softprops/action-gh-release need a runner test / replacement) are a follow-up. tests: the two gpui keystroke tests that flaked on Windows CI (undo pair, snapping toggle — each once, values identical to the pass state, Global-route keys) now dispatch each key with a double park. The root cause is not fully pinned: the loss happens inside gpui's synthetic key dispatch on Windows (both tests hold every test lock; production is unaffected). The CI retry-once remains the backstop. The earlier idea of advancing the simulated clock to flush gpui's pending-input timer is off the table: the mock engine's playback ticks with executor time, so a clock advance moves the playhead out from under the assertions (observed: playhead 14 vs expected 9).
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
# actionlint configuration: whitelist the custom self-hosted runner labels
|
||||
# used by the CD workflow (Warp.dev runners) so `actionlint cd.yml` passes.
|
||||
# See https://github.com/rhysd/actionlint/blob/main/docs/config.md
|
||||
self-hosted-runner:
|
||||
labels:
|
||||
- ubuntu-latest
|
||||
- windows-latest
|
||||
@@ -1,446 +0,0 @@
|
||||
name: CD
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
# ------------------------------------------------------------------
|
||||
# Linux: deb + AppImage + pacman in one job. cargo-packager does not
|
||||
# support rpm (its format list is deb/appimage/pacman/nsis/dmg/app/wix),
|
||||
# and its "pacman" format emits a PKGBUILD + source tarball rather than a
|
||||
# compiled pkg.tar.zst — both are upstream limitations.
|
||||
# ------------------------------------------------------------------
|
||||
# ------------------------------------------------------------------
|
||||
# Linux: one native package per distro, each built INSIDE that
|
||||
# distro's container so the declared dependencies always resolve to
|
||||
# the distro's own package names (dpkg-shlibdeps / rpmbuild
|
||||
# auto-requires / Arch static base list). deb: hand-rolled dpkg-deb;
|
||||
# rpm: rpmbuild; arch: makepkg. AppImage stays on the Ubuntu runner
|
||||
# (self-contained by design).
|
||||
# ------------------------------------------------------------------
|
||||
linux:
|
||||
name: Linux packages (${{ matrix.distro }})
|
||||
runs-on: warp-ubuntu-latest-x64-8x
|
||||
container: ${{ matrix.image }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- distro: debian
|
||||
image: debian:12
|
||||
- distro: fedora
|
||||
image: fedora:41
|
||||
- distro: arch
|
||||
image: archlinux:latest
|
||||
|
||||
steps:
|
||||
# git/curl must land BEFORE actions/checkout runs inside the
|
||||
# container.
|
||||
- name: Install git and fetch tools
|
||||
run: |
|
||||
case "${{ matrix.distro }}" in
|
||||
debian) apt-get update && apt-get install -y git curl ;;
|
||||
fedora) dnf install -y git curl ;;
|
||||
arch) pacman -Sy --noconfirm git curl ;;
|
||||
esac
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Install Rust (stable)
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
- name: Install system dependencies
|
||||
run: |
|
||||
case "${{ matrix.distro }}" in
|
||||
debian)
|
||||
apt-get install -y \
|
||||
build-essential cmake pkg-config nasm dpkg-dev \
|
||||
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 \
|
||||
librsvg2-bin
|
||||
;;
|
||||
fedora)
|
||||
dnf install -y \
|
||||
gcc gcc-c++ cmake pkgconf-pkg-config nasm \
|
||||
pipewire-devel jack-audio-connection-kit-devel \
|
||||
alsa-lib-devel pulseaudio-libs-devel libsndfile-devel \
|
||||
mesa-libGL-devel mesa-vulkan-drivers \
|
||||
vulkan-headers vulkan-loader-devel \
|
||||
libxkbcommon-devel libxkbcommon-x11-devel \
|
||||
rpm-build librsvg2-tools
|
||||
;;
|
||||
arch)
|
||||
pacman -S --needed --noconfirm \
|
||||
base-devel cmake pkgconf nasm \
|
||||
pipewire jack2 alsa-lib libpulse libsndfile \
|
||||
mesa vulkan-headers vulkan-icd-loader \
|
||||
libxkbcommon libxkbcommon-x11 librsvg
|
||||
;;
|
||||
esac
|
||||
|
||||
- name: Configure build environment
|
||||
run: |
|
||||
# OCIO builds from the ocio-sys vendored source (static) on
|
||||
# Linux; the distro packages are too old for the bridge.
|
||||
echo "OCIO_RS_ENABLE_REAL=1" >> "$GITHUB_ENV"
|
||||
echo "OCIO_RS_LINK=static" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Cache cargo artifacts
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
shared-key: oak-${{ matrix.distro }}
|
||||
cache-on-failure: true
|
||||
|
||||
- name: Cache project FFmpeg
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: .cache/ffmpeg
|
||||
key: ffmpeg-${{ matrix.distro }}-${{ hashFiles('tooling/ffmpeg/build-ffmpeg.sh') }}
|
||||
|
||||
- name: Build project FFmpeg (static, GPL + free codecs + hwaccel)
|
||||
run: tooling/ffmpeg/build-ffmpeg.sh
|
||||
|
||||
- name: Build (release)
|
||||
run: cargo build --release --locked
|
||||
|
||||
- name: Generate app icon (PNG from Oak_Icon.svg)
|
||||
run: rsvg-convert -w 512 -h 512 Oak_Icon.svg -o icons/icon.png
|
||||
|
||||
- name: Package
|
||||
run: |
|
||||
set -euo pipefail
|
||||
# The release version lives in [workspace.package] of the root
|
||||
# Cargo.toml (single source of truth; tags do not carry it).
|
||||
VERSION=$(sed -n '/^\[workspace\.package\]/,/^\[/s/^version = "\(.*\)"/\1/p' Cargo.toml | head -1)
|
||||
case "${{ matrix.distro }}" in
|
||||
debian) tooling/package/build-deb.sh "$VERSION" ;;
|
||||
fedora) tooling/package/build-rpm.sh "$VERSION" ;;
|
||||
arch) tooling/package/build-pkg.sh "$VERSION" ;;
|
||||
esac
|
||||
shell: bash
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: oak-linux-${{ matrix.distro }}
|
||||
path: |
|
||||
target/release/*.deb
|
||||
target/release/*.rpm
|
||||
target/release/*.pkg.tar.zst
|
||||
if-no-files-found: error
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# AppImage (self-contained; cargo-packager on the Ubuntu runner).
|
||||
# ------------------------------------------------------------------
|
||||
appimage:
|
||||
name: Linux AppImage
|
||||
runs-on: warp-ubuntu-latest-x64-8x
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Install Rust (stable)
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
- name: Install system dependencies
|
||||
run: |
|
||||
tooling/install-deps.sh
|
||||
sudo apt-get install -y \
|
||||
cmake librsvg2-bin \
|
||||
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
|
||||
|
||||
- name: Configure build environment
|
||||
run: |
|
||||
echo "OCIO_RS_ENABLE_REAL=1" >> "$GITHUB_ENV"
|
||||
echo "OCIO_RS_LINK=static" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Cache cargo artifacts
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
shared-key: oak-appimage
|
||||
cache-on-failure: true
|
||||
|
||||
- name: Cache project FFmpeg
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: .cache/ffmpeg
|
||||
key: ffmpeg-appimage-${{ hashFiles('tooling/ffmpeg/build-ffmpeg.sh') }}
|
||||
|
||||
- name: Build project FFmpeg (static, GPL + free codecs + hwaccel)
|
||||
run: tooling/ffmpeg/build-ffmpeg.sh
|
||||
|
||||
- name: Install cargo-packager
|
||||
run: cargo install cargo-packager --locked
|
||||
|
||||
- name: Generate app icon (PNG from Oak_Icon.svg)
|
||||
run: |
|
||||
mkdir -p icons
|
||||
rsvg-convert -w 512 -h 512 Oak_Icon.svg -o icons/icon.png
|
||||
file icons/icon.png
|
||||
|
||||
- name: Build (release)
|
||||
run: cargo build --release --locked
|
||||
|
||||
- name: Package (AppImage)
|
||||
run: cargo packager --release --formats appimage
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: oak-linux-appimage
|
||||
path: target/release/*.AppImage
|
||||
if-no-files-found: error
|
||||
|
||||
macos:
|
||||
name: macOS DMG (Apple Silicon)
|
||||
runs-on: warp-macos-15-arm64-6x
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Install Rust (stable)
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
- name: Install system dependencies
|
||||
run: |
|
||||
tooling/install-deps.sh
|
||||
brew install cmake librsvg
|
||||
|
||||
- name: Configure build environment
|
||||
run: |
|
||||
{
|
||||
# OCIO comes from the ocio-sys vendored source build (same on
|
||||
# every platform); no OCIO_INSTALL_DIR override.
|
||||
echo "OCIO_RS_ENABLE_REAL=1"
|
||||
echo "OCIO_RS_LINK=static"
|
||||
echo "CFLAGS=-I/opt/homebrew/include"
|
||||
echo "LDFLAGS=-L/opt/homebrew/lib"
|
||||
echo "PKG_CONFIG_PATH=/opt/homebrew/lib/pkgconfig/openjpeg"
|
||||
} >> "$GITHUB_ENV"
|
||||
|
||||
- name: Cache cargo artifacts
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
shared-key: oak-workspace
|
||||
cache-on-failure: true
|
||||
|
||||
- name: Cache project FFmpeg
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: .cache/ffmpeg
|
||||
key: ffmpeg-${{ runner.os }}-${{ hashFiles('tooling/ffmpeg/build-ffmpeg.sh') }}
|
||||
|
||||
- name: Build project FFmpeg (static, GPL + free codecs + hwaccel)
|
||||
run: |
|
||||
tooling/ffmpeg/build-ffmpeg.sh
|
||||
echo "FFMPEG_DIR=$PWD/.cache/ffmpeg" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Install cargo-packager
|
||||
run: cargo install cargo-packager --locked
|
||||
|
||||
- name: Generate app icon (PNG from Oak_Icon.svg)
|
||||
run: |
|
||||
mkdir -p icons
|
||||
# cargo-packager's tauri-icns 0.1.0 maps only 512x512@1x (and
|
||||
# 1024x1024@2x); a plain 1024x1024 PNG aborts with "No matching
|
||||
# IconType", so render 512x512.
|
||||
rsvg-convert -w 512 -h 512 Oak_Icon.svg -o icons/icon.png
|
||||
file icons/icon.png
|
||||
|
||||
# Build the packaged binaries (default members: the app, oak-cli,
|
||||
# oak-worker).
|
||||
- name: Build (release)
|
||||
run: cargo build --release --locked
|
||||
|
||||
- name: Package .app bundle
|
||||
run: cargo packager --release --formats app
|
||||
|
||||
# Pull the Homebrew dylibs the binaries reference into
|
||||
# Contents/Frameworks and rewrite install names to
|
||||
# @executable_path-relative (the script ad-hoc re-signs the bundle).
|
||||
- name: Bundle dylibs into the .app
|
||||
run: tooling/package/bundle-dylibs-macos.sh target/release/Oak.app
|
||||
|
||||
- name: Create DMG
|
||||
run: |
|
||||
rm -rf dmg-staging
|
||||
mkdir -p dmg-staging
|
||||
cp -R target/release/Oak.app dmg-staging/
|
||||
ln -s /Applications dmg-staging/Applications
|
||||
hdiutil create -volname "Oak Video Editor" \
|
||||
-srcfolder dmg-staging -ov -format UDZO Oak-macOS-arm64.dmg
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: oak-macos
|
||||
path: Oak-macOS-arm64.dmg
|
||||
if-no-files-found: error
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# Windows: NSIS installer (restored; cargo-packager downloads its own
|
||||
# makensis, SHA-1 verified). The obsolete `-p oakengine` cdylib prebuild
|
||||
# from before M14 R4 is dropped — no packaged binary links the cdylib.
|
||||
# ------------------------------------------------------------------
|
||||
windows:
|
||||
name: Windows installer (NSIS)
|
||||
runs-on: warp-windows-latest-x64-16x
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: msys2 {0}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Install Rust (stable)
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
- name: Setup MSYS2
|
||||
uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
msystem: UCRT64
|
||||
update: true
|
||||
# MSYS2's own Rust targets x86_64-pc-windows-gnu by default —
|
||||
# the Windows build is GNU-target (the MSVC linker rejects the
|
||||
# Unix-style link args the build scripts emit).
|
||||
install: >-
|
||||
git
|
||||
mingw-w64-ucrt-x86_64-gcc
|
||||
mingw-w64-ucrt-x86_64-rust
|
||||
|
||||
- name: Install system dependencies
|
||||
run: |
|
||||
bash tooling/install-deps.sh
|
||||
pacman -S --needed --noconfirm \
|
||||
mingw-w64-ucrt-x86_64-cmake \
|
||||
mingw-w64-ucrt-x86_64-opencolorio \
|
||||
mingw-w64-ucrt-x86_64-librsvg
|
||||
|
||||
- name: Configure build environment
|
||||
run: |
|
||||
# Windows uses the MSYS2 OpenColorIO package (the exact 2.5.2 the
|
||||
# bridge targets; the vendored source needs MSVC-only constructs).
|
||||
# Dynamic; the DLLs are packaged next to the binaries.
|
||||
echo "OCIO_RS_ENABLE_REAL=1" >> "$GITHUB_ENV"
|
||||
echo "OCIO_INSTALL_DIR=/ucrt64" >> "$GITHUB_ENV"
|
||||
echo "OCIO_RS_LINK=dynamic" >> "$GITHUB_ENV"
|
||||
# ocio-sys' build.rs force-adds the MSVC + Windows SDK include
|
||||
# dirs on Windows (meant for MSVC hosts); with the GNU toolchain
|
||||
# that drags MSVC-only headers into the g++ compile. Unpack the
|
||||
# crate and gate that block behind OCIO_RS_NO_MSVC_INCLUDES.
|
||||
echo "OCIO_RS_NO_MSVC_INCLUDES=1" >> "$GITHUB_ENV"
|
||||
CH=$(cygpath -u "${CARGO_HOME:-$HOME/.cargo}")
|
||||
cargo fetch --locked
|
||||
for cache in "$CH"/registry/cache/*/; do
|
||||
src="$CH/registry/src/$(basename "$cache")"
|
||||
mkdir -p "$src"
|
||||
[ -f "$cache/ocio-sys-0.2.1.crate" ] && tar xzf "$cache/ocio-sys-0.2.1.crate" -C "$src"
|
||||
done
|
||||
BS=$(ls "$CH"/registry/src/*/ocio-sys-0.2.1/build.rs)
|
||||
grep -q 'OCIO_RS_NO_MSVC_INCLUDES' "$BS" || sed -i \
|
||||
's|if cfg!(target_os = "windows") && has_real_ocio {|if cfg!(target_os = "windows") \&\& has_real_ocio \&\& std::env::var_os("OCIO_RS_NO_MSVC_INCLUDES").is_none() {|' \
|
||||
"$BS"
|
||||
grep -q 'OCIO_RS_NO_MSVC_INCLUDES' "$BS"
|
||||
|
||||
- name: Cache cargo artifacts
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
shared-key: oak-workspace
|
||||
cache-on-failure: true
|
||||
|
||||
- name: Cache project FFmpeg
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: .cache/ffmpeg
|
||||
key: ffmpeg-${{ runner.os }}-${{ hashFiles('tooling/ffmpeg/build-ffmpeg.sh') }}
|
||||
|
||||
- name: Build project FFmpeg (static, GPL + free codecs + hwaccel)
|
||||
run: |
|
||||
bash tooling/ffmpeg/build-ffmpeg.sh
|
||||
echo "FFMPEG_DIR=$(cygpath -m "$PWD/.cache/ffmpeg")" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Install cargo-packager
|
||||
run: cargo install cargo-packager --locked
|
||||
|
||||
- name: Generate app icon (PNG from Oak_Icon.svg)
|
||||
run: |
|
||||
mkdir -p icons
|
||||
rsvg-convert -w 512 -h 512 Oak_Icon.svg -o icons/icon.png
|
||||
|
||||
- name: Build (release)
|
||||
run: |
|
||||
# Clear the job-hook-injected MSVC INCLUDE/LIB before the GNU
|
||||
# build (they poison the MinGW compiles with MSVC SDK headers).
|
||||
unset INCLUDE LIB
|
||||
cargo build --release --locked
|
||||
|
||||
# Collect the MSYS2 runtime DLLs (libstdc++/libgcc/OpenColorIO/...)
|
||||
# into target/pkg/win-dlls; the packager `resources` glob then
|
||||
# installs them next to the executables.
|
||||
- name: Bundle runtime DLLs
|
||||
run: |
|
||||
unset INCLUDE LIB
|
||||
pacman -S --needed --noconfirm mingw-w64-ucrt-x86_64-ntldd
|
||||
tooling/package/bundle-dylibs-windows.sh target/pkg/win-dlls \
|
||||
target/release/oak-editor.exe target/release/oak-cli.exe \
|
||||
target/release/oak-worker.exe
|
||||
|
||||
- name: Package (NSIS)
|
||||
run: cargo packager --release --formats nsis
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: oak-windows
|
||||
path: target/release/*-setup.exe
|
||||
if-no-files-found: error
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# Publish: attach every platform package to the v* tag's GitHub release
|
||||
# (skipped on workflow_dispatch, which only uploads artifacts).
|
||||
# ------------------------------------------------------------------
|
||||
release:
|
||||
name: Publish GitHub release
|
||||
needs: [linux, appimage, macos, windows]
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
runs-on: warp-ubuntu-latest-x64-8x
|
||||
steps:
|
||||
- name: Download all artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: artifacts
|
||||
merge-multiple: true
|
||||
|
||||
- name: Publish release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
tag_name: ${{ github.ref_name }}
|
||||
name: ${{ github.ref_name }}
|
||||
draft: false
|
||||
files: artifacts/*
|
||||
|
||||
@@ -1,313 +0,0 @@
|
||||
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:
|
||||
build-test:
|
||||
name: Build & test (${{ matrix.os }})
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os:
|
||||
- ubuntu-latest
|
||||
- windows-latest
|
||||
|
||||
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 (Linux)
|
||||
if: runner.os == 'Linux'
|
||||
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
|
||||
|
||||
- name: Install system dependencies (macOS)
|
||||
if: runner.os == 'macOS'
|
||||
run: |
|
||||
tooling/install-deps.sh
|
||||
brew install cmake
|
||||
|
||||
- name: Setup MSYS2 (Windows)
|
||||
if: runner.os == 'Windows'
|
||||
uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
msystem: UCRT64
|
||||
update: true
|
||||
# MSYS2's own Rust targets x86_64-pc-windows-gnu by default —
|
||||
# the Windows build is GNU-target (the MSVC linker rejects the
|
||||
# Unix-style link args the build scripts emit).
|
||||
install: >-
|
||||
git
|
||||
mingw-w64-ucrt-x86_64-gcc
|
||||
mingw-w64-ucrt-x86_64-rust
|
||||
|
||||
- name: Install system dependencies (Windows)
|
||||
if: runner.os == 'Windows'
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
bash tooling/install-deps.sh
|
||||
pacman -S --needed --noconfirm \
|
||||
mingw-w64-ucrt-x86_64-cmake \
|
||||
mingw-w64-ucrt-x86_64-opencolorio
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# Build environment
|
||||
# ------------------------------------------------------------------
|
||||
# ocio-sys builds a stub bridge unless these are set; the oakcommon
|
||||
# ocioutils tests need the real library (see crates/oakcommon/.cargo/
|
||||
# config.toml, which only applies to builds run from that directory).
|
||||
# ocio-sys builds its vendored OpenColorIO from source on Linux (the
|
||||
# `bundled` feature; the distro package is too old for the bridge),
|
||||
# so no OCIO_INSTALL_DIR here. macOS/Windows keep the system library.
|
||||
- name: Configure build environment (Linux)
|
||||
if: runner.os == 'Linux'
|
||||
run: |
|
||||
echo "OCIO_RS_ENABLE_REAL=1" >> "$GITHUB_ENV"
|
||||
echo "OCIO_RS_LINK=static" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Configure build environment (macOS)
|
||||
if: runner.os == 'macOS'
|
||||
run: |
|
||||
# OCIO comes from the ocio-sys vendored source build (same on
|
||||
# every platform); no OCIO_INSTALL_DIR override.
|
||||
echo "OCIO_RS_ENABLE_REAL=1" >> "$GITHUB_ENV"
|
||||
echo "OCIO_RS_LINK=static" >> "$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" >> "$GITHUB_ENV"
|
||||
echo "LDFLAGS=-L/opt/homebrew/lib" >> "$GITHUB_ENV"
|
||||
echo "PKG_CONFIG_PATH=/opt/homebrew/lib/pkgconfig/openjpeg" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Configure build environment (Windows)
|
||||
if: runner.os == 'Windows'
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
# Windows uses the MSYS2 OpenColorIO package (the exact 2.5.2 the
|
||||
# bridge targets; the vendored source needs MSVC-only constructs).
|
||||
# Dynamic here — the CD packages the DLLs next to the binaries.
|
||||
echo "OCIO_RS_ENABLE_REAL=1" >> "$GITHUB_ENV"
|
||||
echo "OCIO_INSTALL_DIR=/ucrt64" >> "$GITHUB_ENV"
|
||||
echo "OCIO_RS_LINK=dynamic" >> "$GITHUB_ENV"
|
||||
# ocio-sys' build.rs force-adds the MSVC + Windows SDK include
|
||||
# dirs on Windows (meant for MSVC hosts); with the GNU toolchain
|
||||
# that drags MSVC-only headers into the g++ compile. Unpack the
|
||||
# crate and gate that block behind OCIO_RS_NO_MSVC_INCLUDES.
|
||||
echo "OCIO_RS_NO_MSVC_INCLUDES=1" >> "$GITHUB_ENV"
|
||||
CH=$(cygpath -u "${CARGO_HOME:-$HOME/.cargo}")
|
||||
cargo fetch --locked
|
||||
for cache in "$CH"/registry/cache/*/; do
|
||||
src="$CH/registry/src/$(basename "$cache")"
|
||||
mkdir -p "$src"
|
||||
[ -f "$cache/ocio-sys-0.2.1.crate" ] && tar xzf "$cache/ocio-sys-0.2.1.crate" -C "$src"
|
||||
done
|
||||
BS=$(ls "$CH"/registry/src/*/ocio-sys-0.2.1/build.rs)
|
||||
grep -q 'OCIO_RS_NO_MSVC_INCLUDES' "$BS" || sed -i \
|
||||
's|if cfg!(target_os = "windows") && has_real_ocio {|if cfg!(target_os = "windows") \&\& has_real_ocio \&\& std::env::var_os("OCIO_RS_NO_MSVC_INCLUDES").is_none() {|' \
|
||||
"$BS"
|
||||
grep -q 'OCIO_RS_NO_MSVC_INCLUDES' "$BS"
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# 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-workspace
|
||||
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 (Linux/macOS)
|
||||
if: runner.os != 'Windows'
|
||||
run: |
|
||||
tooling/ffmpeg/build-ffmpeg.sh
|
||||
echo "FFMPEG_DIR=$PWD/.cache/ffmpeg" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Build project FFmpeg (Windows)
|
||||
if: runner.os == 'Windows'
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
bash tooling/ffmpeg/build-ffmpeg.sh
|
||||
echo "FFMPEG_DIR=$(cygpath -m "$PWD/.cache/ffmpeg")" >> "$GITHUB_ENV"
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# Build & test
|
||||
# ------------------------------------------------------------------
|
||||
- name: Build (Linux)
|
||||
if: runner.os == 'Linux'
|
||||
run: cargo build --workspace --locked
|
||||
|
||||
- name: Build (macOS)
|
||||
if: runner.os == 'macOS'
|
||||
run: cargo build --workspace --locked
|
||||
|
||||
- name: Build (Windows)
|
||||
if: runner.os == 'Windows'
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
# The runner's job hook injects the MSVC INCLUDE/LIB into every
|
||||
# step; clear them in-step (they poison the MinGW compiles with
|
||||
# MSVC SDK headers).
|
||||
unset INCLUDE LIB
|
||||
# mingw-w64 >= Nov 2025 forwards _assert to __msvcrt_assert inside
|
||||
# libmingwex.a; rustc's link order puts -lmingwex last, so any
|
||||
# binary that pulls _assert.o leaves _fileno/_setmode/
|
||||
# __imp___msvcrt_assert unresolved. A trailing -lmsvcrt re-scans
|
||||
# the CRT import lib after libmingwex.
|
||||
export RUSTFLAGS="-C link-args=-lmsvcrt"
|
||||
cargo build --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 1500 s (a green run needs ~4 min) it dumps
|
||||
# every hung process's thread stacks and kills the suite.
|
||||
- name: Test (Linux)
|
||||
if: runner.os == 'Linux'
|
||||
run: |
|
||||
sudo apt-get install -y gdb
|
||||
xvfb-run -a -s "-screen 0 1920x1080x24" cargo test --workspace --locked &
|
||||
TEST_PID=$!
|
||||
(
|
||||
sleep 1500
|
||||
echo "::warning::test suite exceeded 1500s; 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
|
||||
) &
|
||||
WATCHDOG_PID=$!
|
||||
wait $TEST_PID
|
||||
rc=$?
|
||||
kill $WATCHDOG_PID 2>/dev/null || true
|
||||
exit $rc
|
||||
|
||||
# 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 (Linux)
|
||||
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
|
||||
|
||||
- name: Test (macOS)
|
||||
if: runner.os == 'macOS'
|
||||
run: cargo test --workspace --locked
|
||||
|
||||
- name: Test (Windows)
|
||||
if: runner.os == 'Windows'
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
unset INCLUDE LIB
|
||||
# See Build (Windows): trailing -lmsvcrt for the mingw-w64
|
||||
# _assert/__msvcrt_assert link-order breakage.
|
||||
export RUSTFLAGS="-C link-args=-lmsvcrt"
|
||||
if ! cargo test --workspace --locked; then
|
||||
# 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.
|
||||
echo "first pass failed; retrying once for gpui keystroke flakes"
|
||||
cargo test --workspace --locked
|
||||
fi
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# 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 (Linux/macOS)
|
||||
if: runner.os != 'Windows'
|
||||
run: crates/oakplugin/tests/fixtures/build_fixture.sh .cache/ofx-fixture
|
||||
|
||||
- name: Probe OFX plugin discovery (Linux/macOS)
|
||||
if: runner.os != 'Windows'
|
||||
run: |
|
||||
OFX_PLUGIN_PATH="$PWD/.cache/ofx-fixture" \
|
||||
cargo run --locked -p oakplugin --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-fixtre" \
|
||||
cargo test --locked -p oakplugin --test ofx_roundtrip
|
||||
Reference in New Issue
Block a user