Skip to content

Commit b43942d

Browse files
author
Dylan Storey
committed
Fix CI, update release workflow, bump to alpha.2
CI fixes: - Fix mktemp calls to use XXXXXX template (required on Linux) - Add mingw-w64-x86_64-libsystre and link -lsystre for regex on Windows - Run full performance test suite - Add Python/Rust binding tests on Windows in ci-full.yml Release workflow: - Build on Linux x86_64, macOS x86_64, macOS arm64, Windows x86_64 - Build with RELEASE=1 flag (optimized -O2, no debug symbols/output) - Install and test Python/Rust bindings on all platforms - Only publish after all binding tests pass Version bumps: - Python: 0.0.0a2 - Rust: 0.0.0-alpha.2
1 parent e7a2016 commit b43942d

File tree

9 files changed

+133
-28
lines changed

9 files changed

+133
-28
lines changed

.github/workflows/ci-fast.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ jobs:
9797
install: >-
9898
mingw-w64-x86_64-gcc
9999
mingw-w64-x86_64-sqlite3
100+
mingw-w64-x86_64-libsystre
100101
bison
101102
flex
102103
make

.github/workflows/ci-full.yml

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ jobs:
173173
install: >-
174174
mingw-w64-x86_64-gcc
175175
mingw-w64-x86_64-sqlite3
176+
mingw-w64-x86_64-libsystre
176177
bison
177178
flex
178179
make
@@ -183,6 +184,27 @@ jobs:
183184
- name: Run functional tests
184185
run: make test-functional
185186

187+
# Python binding tests (native Windows Python)
188+
- name: Set up Python
189+
uses: actions/setup-python@v5
190+
with:
191+
python-version: '3.11'
192+
193+
- name: Install and test Python bindings
194+
shell: bash
195+
run: |
196+
pip install -e "./bindings/python[dev]"
197+
cd bindings/python && pytest tests/ -v
198+
199+
# Rust binding tests (native Windows Rust)
200+
- name: Install Rust toolchain
201+
uses: dtolnay/rust-toolchain@stable
202+
203+
- name: Test Rust bindings
204+
shell: bash
205+
working-directory: bindings/rust
206+
run: cargo test -- --test-threads=1
207+
186208
performance-tests:
187209
runs-on: ubuntu-latest
188210

@@ -197,8 +219,5 @@ jobs:
197219
- name: Build extension
198220
run: make extension
199221

200-
- name: Run quick performance tests
201-
run: make test-perf-quick
202-
203-
- name: Run performance summary
204-
run: make performance 100k
222+
- name: Run performance tests
223+
run: make performance

.github/workflows/release.yml

Lines changed: 91 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,49 @@ on:
66
- 'v*'
77

88
jobs:
9-
build-extension:
9+
build-and-test:
1010
strategy:
1111
fail-fast: false
1212
matrix:
1313
include:
1414
- os: ubuntu-latest
1515
artifact: graphqlite.so
16-
- os: macos-latest
16+
artifact-name: graphqlite-linux-x86_64.so
17+
- os: macos-14
18+
arch: arm64
1719
artifact: graphqlite.dylib
20+
artifact-name: graphqlite-macos-arm64.dylib
21+
- os: macos-14
22+
arch: x86_64
23+
artifact: graphqlite.dylib
24+
artifact-name: graphqlite-macos-x86_64.dylib
25+
- os: windows-latest
26+
artifact: graphqlite.dll
27+
artifact-name: graphqlite-windows-x86_64.dll
1828

1929
runs-on: ${{ matrix.os }}
2030

31+
defaults:
32+
run:
33+
shell: ${{ matrix.os == 'windows-latest' && 'msys2 {0}' || 'bash' }}
34+
2135
steps:
2236
- uses: actions/checkout@v4
2337

38+
- name: Setup MSYS2 (Windows)
39+
if: runner.os == 'Windows'
40+
uses: msys2/setup-msys2@v2
41+
with:
42+
msystem: MINGW64
43+
update: true
44+
install: >-
45+
mingw-w64-x86_64-gcc
46+
mingw-w64-x86_64-sqlite3
47+
mingw-w64-x86_64-libsystre
48+
bison
49+
flex
50+
make
51+
2452
- name: Install dependencies (Linux)
2553
if: runner.os == 'Linux'
2654
run: |
@@ -34,23 +62,74 @@ jobs:
3462
echo "$(brew --prefix bison)/bin" >> $GITHUB_PATH
3563
echo "$(brew --prefix flex)/bin" >> $GITHUB_PATH
3664
echo "HOMEBREW_PREFIX=$(brew --prefix)" >> $GITHUB_ENV
65+
echo "SQLITE_PREFIX=$(brew --prefix sqlite)" >> $GITHUB_ENV
3766
3867
- name: Build extension (Linux)
3968
if: runner.os == 'Linux'
40-
run: make extension
69+
run: make extension RELEASE=1
4170

42-
- name: Build extension (macOS)
43-
if: runner.os == 'macOS'
44-
run: make extension EXTRA_INCLUDES="-I$HOMEBREW_PREFIX/include" EXTRA_LIBS="-L$HOMEBREW_PREFIX/lib"
71+
- name: Build extension (macOS arm64)
72+
if: runner.os == 'macOS' && matrix.arch == 'arm64'
73+
run: make extension RELEASE=1 EXTRA_INCLUDES="-I$HOMEBREW_PREFIX/include" EXTRA_LIBS="-L$HOMEBREW_PREFIX/lib"
74+
75+
- name: Build extension (macOS x86_64 cross-compile)
76+
if: runner.os == 'macOS' && matrix.arch == 'x86_64'
77+
run: make extension RELEASE=1 CC="clang -arch x86_64" EXTRA_INCLUDES="-I$HOMEBREW_PREFIX/include" EXTRA_LIBS="-L$HOMEBREW_PREFIX/lib"
78+
79+
- name: Build extension (Windows)
80+
if: runner.os == 'Windows'
81+
run: make extension RELEASE=1
82+
83+
# Python binding tests
84+
- name: Set up Python (Linux/Windows)
85+
if: runner.os != 'macOS'
86+
uses: actions/setup-python@v5
87+
with:
88+
python-version: '3.11'
89+
90+
- name: Install and test Python bindings (Linux)
91+
if: runner.os == 'Linux'
92+
run: |
93+
pip install -e "./bindings/python[dev]"
94+
cd bindings/python && pytest tests/ -v
95+
96+
- name: Install and test Python bindings (macOS)
97+
if: runner.os == 'macOS' && matrix.arch == 'arm64'
98+
run: |
99+
# Use Homebrew Python which supports extension loading
100+
brew install python@3.11
101+
$(brew --prefix python@3.11)/libexec/bin/python -m pip install -e "./bindings/python[dev]"
102+
DYLD_LIBRARY_PATH="$SQLITE_PREFIX/lib:$DYLD_LIBRARY_PATH" $(brew --prefix python@3.11)/libexec/bin/python -m pytest bindings/python/tests/ -v
103+
104+
- name: Install and test Python bindings (Windows)
105+
if: runner.os == 'Windows'
106+
shell: bash
107+
run: |
108+
pip install -e "./bindings/python[dev]"
109+
cd bindings/python && pytest tests/ -v
110+
111+
# Rust binding tests (skip for cross-compiled x86_64)
112+
- name: Install Rust toolchain
113+
if: matrix.arch != 'x86_64'
114+
uses: dtolnay/rust-toolchain@stable
115+
116+
- name: Test Rust bindings
117+
if: matrix.arch != 'x86_64'
118+
working-directory: bindings/rust
119+
shell: bash
120+
run: cargo test -- --test-threads=1
121+
122+
- name: Rename artifact
123+
run: cp build/${{ matrix.artifact }} build/${{ matrix.artifact-name }}
45124

46125
- name: Upload extension artifact
47126
uses: actions/upload-artifact@v4
48127
with:
49-
name: extension-${{ matrix.os }}
50-
path: build/${{ matrix.artifact }}
128+
name: ${{ matrix.artifact-name }}
129+
path: build/${{ matrix.artifact-name }}
51130

52131
publish-python:
53-
needs: build-extension
132+
needs: build-and-test
54133
runs-on: ubuntu-latest
55134

56135
steps:
@@ -76,6 +155,7 @@ jobs:
76155
run: twine upload dist/*
77156

78157
publish-rust:
158+
needs: build-and-test
79159
runs-on: ubuntu-latest
80160

81161
steps:
@@ -91,7 +171,7 @@ jobs:
91171
run: cargo publish --allow-dirty
92172

93173
create-release:
94-
needs: [build-extension, publish-python, publish-rust]
174+
needs: [build-and-test, publish-python, publish-rust]
95175
runs-on: ubuntu-latest
96176

97177
steps:
@@ -106,6 +186,5 @@ jobs:
106186
uses: softprops/action-gh-release@v1
107187
with:
108188
files: |
109-
artifacts/extension-ubuntu-latest/*
110-
artifacts/extension-macos-latest/*
189+
artifacts/**/*
111190
generate_release_notes: true

Makefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,14 @@ PYTHON ?= python3.11
1414
EXTRA_INCLUDES ?=
1515
EXTRA_LIBS ?=
1616

17+
# Build mode: debug (default) or release
18+
# Use: make extension RELEASE=1
19+
ifdef RELEASE
20+
CFLAGS = -Wall -Wextra -O2 -I./src/include $(EXTRA_INCLUDES)
21+
else
1722
# Add -DGRAPHQLITE_PERF_TIMING for detailed query timing instrumentation
1823
CFLAGS = -Wall -Wextra -g -I./src/include $(EXTRA_INCLUDES) -DGRAPHQLITE_DEBUG
24+
endif
1925
LDFLAGS = $(EXTRA_LIBS) -lcunit -lsqlite3
2026

2127
# Extension-specific flags: enable sqlite3ext.h API pointer redirection
@@ -173,9 +179,9 @@ $(EXTENSION_LIB): $(EXTENSION_OBJ) $(PARSER_OBJS_PIC) $(TRANSFORM_OBJS_PIC) $(EX
173179
ifeq ($(UNAME_S),Darwin)
174180
$(CC) -g -fPIC -dynamiclib $(EXTENSION_OBJ) $(PARSER_OBJS_PIC) $(TRANSFORM_OBJS_PIC) $(EXECUTOR_OBJS_PIC) -o $@ -undefined dynamic_lookup
175181
else ifneq (,$(findstring MINGW,$(UNAME_S)))
176-
$(CC) -shared $(EXTENSION_OBJ) $(PARSER_OBJS_PIC) $(TRANSFORM_OBJS_PIC) $(EXECUTOR_OBJS_PIC) -o $@ -lsqlite3
182+
$(CC) -shared $(EXTENSION_OBJ) $(PARSER_OBJS_PIC) $(TRANSFORM_OBJS_PIC) $(EXECUTOR_OBJS_PIC) -o $@ -lsqlite3 -lsystre
177183
else ifneq (,$(findstring MSYS,$(UNAME_S)))
178-
$(CC) -shared $(EXTENSION_OBJ) $(PARSER_OBJS_PIC) $(TRANSFORM_OBJS_PIC) $(EXECUTOR_OBJS_PIC) -o $@ -lsqlite3
184+
$(CC) -shared $(EXTENSION_OBJ) $(PARSER_OBJS_PIC) $(TRANSFORM_OBJS_PIC) $(EXECUTOR_OBJS_PIC) -o $@ -lsqlite3 -lsystre
179185
else
180186
$(CC) -shared -fPIC $(EXTENSION_OBJ) $(PARSER_OBJS_PIC) $(TRANSFORM_OBJS_PIC) $(EXECUTOR_OBJS_PIC) -o $@
181187
endif

bindings/python/src/graphqlite/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
from .connection import Connection, connect, wrap
44

5-
__version__ = "0.0.0a1"
5+
__version__ = "0.0.0a2"
66
__all__ = ["Connection", "connect", "wrap"]

bindings/rust/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "graphqlite"
3-
version = "0.0.0-alpha.1"
3+
version = "0.0.0-alpha.2"
44
edition = "2021"
55
description = "SQLite extension for graph queries using Cypher"
66
license = "MIT"

tests/performance/run_all_perf.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ run_tests_for_size() {
192192
local size_label=$(fmt_num $size)
193193
echo "Building ${size_label} node graph..."
194194

195-
db=$(mktemp /tmp/gql_perf_$$.db)
195+
db=$(mktemp /tmp/gql_perf_XXXXXX.db)
196196

197197
# Build graph once
198198
start=$(get_time_ms)

tests/performance/run_pagerank_perf.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ test_pagerank_scale() {
146146
local size=$1
147147
local edges_per_node=$2
148148
local pr_iterations=${3:-20}
149-
local db=$(mktemp /tmp/gql_pagerank_$$.db)
149+
local db=$(mktemp /tmp/gql_pagerank_XXXXXX.db)
150150

151151
echo "=== PageRank Test (n=$size, edges/node=$edges_per_node, pr_iter=$pr_iterations) ==="
152152

@@ -185,7 +185,7 @@ test_pagerank_scale() {
185185
# ============================================
186186
test_iteration_impact() {
187187
local size=$1
188-
local db=$(mktemp /tmp/gql_pagerank_iter_$$.db)
188+
local db=$(mktemp /tmp/gql_pagerank_iter_XXXXXX.db)
189189

190190
echo "=== Iteration Impact (n=$size) ==="
191191

tests/performance/run_scaled_perf_tests.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ EOF
192192
# ============================================
193193
test_linear_chain() {
194194
local size=$1
195-
local db=$(mktemp /tmp/gql_linear_$$.db)
195+
local db=$(mktemp /tmp/gql_linear_XXXXXX.db)
196196

197197
echo "=== Linear Chain Graph (n=$size) ==="
198198
echo "Structure: 1->2->3->...->$size"
@@ -234,7 +234,7 @@ test_linear_chain() {
234234
# ============================================
235235
test_hub_spoke() {
236236
local size=$1
237-
local db=$(mktemp /tmp/gql_hub_$$.db)
237+
local db=$(mktemp /tmp/gql_hub_XXXXXX.db)
238238

239239
echo "=== Hub-and-Spoke Graph (n=$size) ==="
240240
echo "Structure: Hub connected to $((size-1)) spokes"
@@ -299,7 +299,7 @@ EOF
299299
test_dense_mesh() {
300300
local size=$1
301301
local conn=$2
302-
local db=$(mktemp /tmp/gql_mesh_$$.db)
302+
local db=$(mktemp /tmp/gql_mesh_XXXXXX.db)
303303

304304
echo "=== Dense Mesh Graph (n=$size, connectivity=$conn) ==="
305305
echo "Structure: Each node connects to next $conn nodes"
@@ -341,7 +341,7 @@ test_dense_mesh() {
341341
# ============================================
342342
test_tree() {
343343
local depth=$1
344-
local db=$(mktemp /tmp/gql_tree_$$.db)
344+
local db=$(mktemp /tmp/gql_tree_XXXXXX.db)
345345
local total=$(( (1 << (depth + 1)) - 1 ))
346346

347347
echo "=== Binary Tree Graph (depth=$depth) ==="

0 commit comments

Comments
 (0)