-
-
Notifications
You must be signed in to change notification settings - Fork 0
128 lines (107 loc) · 3.63 KB
/
Copy pathci.yml
File metadata and controls
128 lines (107 loc) · 3.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# This workflow is managed by gh actions-lock.
# SPDX-License-Identifier: MPL-2.0
# This workflow is managed by gh actions-lock.
# This workflow is managed by gh actions-lock.
# This workflow is managed by gh actions-lock.
# 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@v7.0.1
- name: Setup Zig
uses: goto-bus-stop/setup-zig@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@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@v7.0.1
- 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 ABI regression tests
runs-on: ubuntu-latest
needs: build-zig
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v7.0.1
- name: Setup Zig
uses: goto-bus-stop/setup-zig@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'