Files
kryon/.github/workflows/ci.yml
T
waozi 629602607d Install GStreamer in CI and make silent test failures visible
The runner had no GStreamer, so the native video test could not open its
fixture and exited 4 without a message; the base, good and libav plugins
decode it on Ubuntu 24.04. The video test now prints why a video did not
open, the desktop wait test shows its program's output and status when it
fails, and the test runner reports every failing script's exit status.

The Windows typeface boundary links without Raylib and depends on the
optimizer dropping calls Windows never reaches. Sanitizer instrumentation
keeps those calls in the C++ build, so that link is built uninstrumented.
2026-10-11 12:27:10 -03:00

222 lines
7.4 KiB
YAML

name: CI
on:
push:
branches: [master]
pull_request:
workflow_dispatch:
# Several sessions push master many times an hour, longer apart than a run
# takes; cancelling on master left no finished run. Only pull requests
# replace their older runs.
concurrency:
group: ci-${{ github.ref }}-${{ github.event_name == 'pull_request' && 'pr' || github.sha }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
ZIRAN_ROOT: ${{ github.workspace }}/ziran
jobs:
test-linux:
name: Ziran library and host tests
runs-on: ubuntu-latest
defaults:
run:
working-directory: kryon
steps:
- name: Checkout Kryon
uses: actions/checkout@v7
with:
path: kryon
- name: Read locked toolchain
id: toolchain
run: |
git checkout -B master
python3 -c 'import json; print("commit=" + json.load(open("ziran.lock"))["toolchain"]["commit"])' >> "$GITHUB_OUTPUT"
- name: Checkout Ziran
uses: actions/checkout@v7
with:
repository: ziranlang/ziran
ref: ${{ steps.toolchain.outputs.commit }}
path: ziran
# Template tests serve this checkout through local Git URLs and use
# the manifest's master ref. Keep that ref at the locked commit.
- name: Prepare locked toolchain ref
run: git -C "$ZIRAN_ROOT" checkout -B master
- name: Install build tools
run: |
sudo apt-get update
sudo apt-get install -y build-essential python3 ripgrep xvfb \
pkg-config libsdl2-dev libcairo2-dev libfreetype-dev libfontconfig1-dev libcurl4-openssl-dev \
xclip xdotool x11-xserver-utils python3-gi python3-pil ffmpeg gir1.2-gtk-3.0 gir1.2-atspi-2.0 \
libglib2.0-dev libpango1.0-dev at-spi2-core dbus-x11 \
gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-libav
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: '1.25.x'
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: '22'
- name: Check submodule URLs
run: sh scripts/check-submodule-urls.sh
# The Canvas2D and DOM tests compile to Wasm with emscripten and run
# in private headless Chrome; the tests look for ~/emsdk.
- name: Restore emsdk
id: emsdk
uses: actions/cache@v6
with:
path: ~/emsdk
key: emsdk-${{ runner.os }}-6.0.6
- name: Install emsdk
if: steps.emsdk.outputs.cache-hit != 'true'
working-directory: .
run: |
git clone https://github.com/emscripten-core/emsdk.git ~/emsdk
~/emsdk/emsdk install 6.0.6
~/emsdk/emsdk activate 6.0.6
- name: Build and test
env:
CHROMIUM: google-chrome
run: env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS YUE_DESKTOP_RECOVERY=0 make test
- name: Check repeatable frame workloads
run: python3 tools/performance.py --budget-ms 64
- name: Test SVG example
run: env -u DISPLAY -u WAYLAND_DISPLAY make -C examples test
- name: Test live preview and rendered themes
env:
CHROMIUM: google-chrome
run: env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY node tests/demo_browser.mjs
test-sanitizers:
name: Behavior tests under AddressSanitizer and UndefinedBehaviorSanitizer
runs-on: ubuntu-latest
defaults:
run:
working-directory: kryon
steps:
- name: Checkout Kryon
uses: actions/checkout@v7
with:
path: kryon
- name: Read locked toolchain
id: toolchain
run: |
git checkout -B master
python3 -c 'import json; print("commit=" + json.load(open("ziran.lock"))["toolchain"]["commit"])' >> "$GITHUB_OUTPUT"
- name: Checkout Ziran
uses: actions/checkout@v7
with:
repository: ziranlang/ziran
ref: ${{ steps.toolchain.outputs.commit }}
path: ziran
- name: Prepare locked toolchain ref
run: git -C "$ZIRAN_ROOT" checkout -B master
- name: Install build tools
run: |
sudo apt-get update
sudo apt-get install -y build-essential python3 python3-pil ripgrep ffmpeg \
pkg-config libsdl2-dev libcairo2-dev libglib2.0-dev libpango1.0-dev libfreetype-dev libfontconfig1-dev \
gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-libav
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: '1.25.x'
- name: Run the behavior tests with sanitized C and C++
run: env -u DISPLAY -u WAYLAND_DISPLAY make sanitize-test TEST_JOBS=4
test-desktop-hosts:
name: Desktop, raylib, and libdraw hosts on private Xvfb
runs-on: ubuntu-latest
defaults:
run:
working-directory: kryon
steps:
- name: Checkout Kryon
uses: actions/checkout@v7
with:
path: kryon
- name: Read locked toolchain
id: toolchain
run: |
git checkout -B master
python3 -c 'import json; print("commit=" + json.load(open("ziran.lock"))["toolchain"]["commit"])' >> "$GITHUB_OUTPUT"
- name: Checkout Ziran
uses: actions/checkout@v7
with:
repository: ziranlang/ziran
ref: ${{ steps.toolchain.outputs.commit }}
path: ziran
- name: Prepare locked toolchain ref
run: git -C "$ZIRAN_ROOT" checkout -B master
- name: Install host libraries and X tools
run: |
sudo apt-get update
sudo apt-get install -y build-essential python3 pkg-config \
libsdl2-dev libcairo2-dev libglib2.0-dev libpango1.0-dev libdrm-dev libgbm-dev libegl-dev libgles-dev \
libegl-mesa0 libgl1-mesa-dri \
libx11-dev libxt-dev libxext-dev libfontconfig1-dev libfreetype-dev \
fonts-dejavu-core fonts-wqy-zenhei \
xvfb xdotool x11-apps x11-utils imagemagick xfwm4 dbus-x11
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: '1.25.x'
- name: Restore plan9port
id: plan9port
uses: actions/cache@v6
with:
path: plan9port
key: plan9port-${{ runner.os }}-337c6acbfed51d8d9f08598c6cd398f53abcca7d
- name: Build plan9port for the libdraw host
if: steps.plan9port.outputs.cache-hit != 'true'
working-directory: .
run: |
git clone https://github.com/9fans/plan9port.git plan9port
git -C plan9port checkout 337c6acbfed51d8d9f08598c6cd398f53abcca7d
cd plan9port && ./INSTALL -b
# Each test starts its own display with xvfb-run -a; none may reach a
# real one.
- name: Desktop host
run: env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY make desktop-project-test
- name: Raylib host
run: env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY make raylib-project-test
- name: Raylib font coverage and collections
run: |
RAYLIB_A="$PWD/build/raylib-ziran/libraylib.a" \
RAYLIB_LIBS="$(pkg-config --libs sdl2 libdrm gbm egl glesv2) -ldl -lpthread -lm" \
make raylib-typeface-test raylib-trace-test raylib-secondary-window-test
- name: Libdraw host
run: env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY make libdraw-project-test