Skip to content

Fix the red on main: Zig build error, Forth load order, and a fake Forth gate #14

Fix the red on main: Zig build error, Forth load order, and a fake Forth gate

Fix the red on main: Zig build error, Forth load order, and a fake Forth gate #14

Workflow file for this run

# SPDX-License-Identifier: MPL-2.0
# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
#
# Lithoglyph CI — Build and test all components
#
# Runs on push to main and all pull requests.
# Tests: Zig core, Forth blocks, C FFI integration.
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions: read-all
jobs:
# ===========================================================================
# Job 1: Build and test core-zig
# ===========================================================================
build-zig:
name: Build & Test core-zig
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v4
- name: Setup Zig
uses: goto-bus-stop/setup-zig@abea47f85e598557f500fa1fd2ab7464fcb39406 # v2.2.1
with:
version: '0.15.2'
- name: Build core-zig
working-directory: core-zig
run: zig build
- name: Run core-zig tests
working-directory: core-zig
run: zig build test
- name: Upload Zig build artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: zig-build
path: |
core-zig/zig-out/lib/
retention-days: 1
# ===========================================================================
# Job 2: Forth block tests
# ===========================================================================
test-forth:
name: Forth Block Tests
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v4
- name: Install gforth
run: sudo apt-get update && sudo apt-get install -y gforth
- name: Run Forth block tests
working-directory: core-forth/test
run: gforth test-blocks.fs -e bye
- name: Verify Forth source files load
working-directory: core-forth/src
run: |
gforth lithoglyph-blocks.fs -e 'bye'
gforth lithoglyph-journal.fs -e 'bye'
gforth lithoglyph-model.fs -e 'bye'
# ===========================================================================
# Job 3: C FFI integration tests (depends on Zig build)
# ===========================================================================
test-ffi:
name: C FFI Integration Tests
runs-on: ubuntu-latest
needs: build-zig
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v4
- name: Setup Zig
uses: goto-bus-stop/setup-zig@abea47f85e598557f500fa1fd2ab7464fcb39406 # v2.2.1
with:
version: '0.15.2'
- name: Build Zig libraries
working-directory: core-zig
run: zig build
- name: Compile C FFI integration tests
working-directory: core-zig
run: |
gcc -I../generated/abi \
-o test-ffi-integration \
test-ffi-integration.c \
-Lzig-out/lib \
-llith_bridge
- name: Run FFI integration tests
working-directory: core-zig
run: |
LD_LIBRARY_PATH=zig-out/lib ./test-ffi-integration
- name: Verify ABI exports
working-directory: core-zig
run: |
nm -D zig-out/lib/liblith_bridge.so | grep -q 'lith_db_open'
nm -D zig-out/lib/liblith_bridge.so | grep -q 'lith_apply'
nm -D zig-out/lib/liblith_bridge.so | grep -q 'lith_version'
nm -D zig-out/lib/liblith_bridge.so | grep -q 'lith_introspect_schema'