1- name : CI Full
1+ name : CI
22
33on :
44 push :
55 branches : [main]
6+ pull_request :
7+ branches : [main]
68
79jobs :
8- build-and-test-unix :
10+ # =============================================================================
11+ # Fast Tests - Run first on all PRs and pushes
12+ # =============================================================================
13+
14+ build-and-test :
15+ runs-on : ubuntu-latest
16+ steps :
17+ - uses : actions/checkout@v4
18+
19+ - name : Install dependencies
20+ run : |
21+ sudo apt-get update
22+ sudo apt-get install -y bison flex libsqlite3-dev libcunit1-dev
23+
24+ - name : Build extension
25+ run : make extension
26+
27+ - name : Run unit tests
28+ run : make test-unit
29+
30+ - name : Run functional tests
31+ run : make test-functional
32+
33+ rust-check :
34+ runs-on : ubuntu-latest
35+ steps :
36+ - uses : actions/checkout@v4
37+
38+ - name : Install Rust toolchain
39+ uses : dtolnay/rust-toolchain@stable
40+ with :
41+ components : clippy
42+
43+ - name : Install dependencies
44+ run : |
45+ sudo apt-get update
46+ sudo apt-get install -y bison flex libsqlite3-dev
47+
48+ - name : Build extension
49+ run : make extension
50+
51+ - name : Copy extension to Rust libs
52+ run : |
53+ mkdir -p bindings/rust/libs
54+ cp build/graphqlite.so bindings/rust/libs/graphqlite-linux-x86_64.so
55+
56+ - name : Cargo check
57+ working-directory : bindings/rust
58+ run : cargo check
59+
60+ - name : Cargo clippy
61+ working-directory : bindings/rust
62+ run : cargo clippy -- -D warnings
63+
64+ python-check :
65+ runs-on : ubuntu-latest
66+ steps :
67+ - uses : actions/checkout@v4
68+
69+ - name : Set up Python
70+ uses : actions/setup-python@v5
71+ with :
72+ python-version : ' 3.11'
73+
74+ - name : Install dependencies
75+ run : |
76+ sudo apt-get update
77+ sudo apt-get install -y bison flex libsqlite3-dev
78+
79+ - name : Build extension
80+ run : make extension
81+
82+ - name : Install Python package
83+ working-directory : bindings/python
84+ run : pip install -e ".[dev]"
85+
86+ - name : Run Python tests
87+ working-directory : bindings/python
88+ run : pytest tests/ -v
89+
90+ windows-build :
91+ runs-on : windows-latest
92+ defaults :
93+ run :
94+ shell : msys2 {0}
95+ steps :
96+ - uses : actions/checkout@v4
97+
98+ - name : Setup MSYS2
99+ uses : msys2/setup-msys2@v2
100+ with :
101+ msystem : MINGW64
102+ update : true
103+ install : >-
104+ mingw-w64-x86_64-gcc
105+ mingw-w64-x86_64-sqlite3
106+ mingw-w64-x86_64-libsystre
107+ bison
108+ flex
109+ make
110+
111+ - name : Build extension
112+ run : make extension
113+
114+ - name : Run functional tests
115+ run : make test-functional
116+
117+ # =============================================================================
118+ # Full Tests - Run after fast tests pass
119+ # =============================================================================
120+
121+ full-build-unix :
122+ needs : [build-and-test, rust-check, python-check, windows-build]
9123 strategy :
10124 fail-fast : false
11125 matrix :
12126 os : [ubuntu-latest, macos-latest]
13-
14127 runs-on : ${{ matrix.os }}
15-
16128 steps :
17129 - uses : actions/checkout@v4
18130
@@ -31,12 +143,7 @@ jobs:
31143 echo "HOMEBREW_PREFIX=$(brew --prefix)" >> $GITHUB_ENV
32144 echo "SQLITE_PREFIX=$(brew --prefix sqlite)" >> $GITHUB_ENV
33145
34- - name : Build extension (Linux)
35- if : runner.os == 'Linux'
36- run : make extension
37-
38- - name : Build extension (macOS)
39- if : runner.os == 'macOS'
146+ - name : Build extension
40147 run : make extension
41148
42149 - name : Run unit tests (Linux)
@@ -55,14 +162,19 @@ jobs:
55162 if : runner.os == 'macOS'
56163 run : make test-functional EXTRA_INCLUDES="-I$HOMEBREW_PREFIX/include" EXTRA_LIBS="-L$HOMEBREW_PREFIX/lib" SQLITE="$SQLITE_PREFIX/bin/sqlite3"
57164
58- rust-tests :
165+ full-rust-tests :
166+ needs : [build-and-test, rust-check, python-check, windows-build]
59167 strategy :
60168 fail-fast : false
61169 matrix :
62- os : [ubuntu-latest, macos-latest]
63-
170+ include :
171+ - os : ubuntu-latest
172+ lib_name : graphqlite-linux-x86_64.so
173+ ext_file : graphqlite.so
174+ - os : macos-latest
175+ lib_name : graphqlite-macos-aarch64.dylib
176+ ext_file : graphqlite.dylib
64177 runs-on : ${{ matrix.os }}
65-
66178 steps :
67179 - uses : actions/checkout@v4
68180
@@ -81,28 +193,26 @@ jobs:
81193 brew install bison flex sqlite
82194 echo "$(brew --prefix bison)/bin" >> $GITHUB_PATH
83195 echo "$(brew --prefix flex)/bin" >> $GITHUB_PATH
84- echo "HOMEBREW_PREFIX=$(brew --prefix)" >> $GITHUB_ENV
85196
86- - name : Build extension (Linux)
87- if : runner.os == 'Linux'
197+ - name : Build extension
88198 run : make extension
89199
90- - name : Build extension (macOS)
91- if : runner.os == 'macOS'
92- run : make extension
200+ - name : Copy extension to Rust libs
201+ run : |
202+ mkdir -p bindings/rust/libs
203+ cp build/${{ matrix.ext_file }} bindings/rust/libs/${{ matrix.lib_name }}
93204
94205 - name : Run Rust tests
95206 working-directory : bindings/rust
96207 run : cargo test --lib --test integration -- --test-threads=1
97208
98- python-tests-linux :
209+ full-python-tests-linux :
210+ needs : [build-and-test, rust-check, python-check, windows-build]
99211 strategy :
100212 fail-fast : false
101213 matrix :
102214 python-version : ['3.9', '3.10', '3.11', '3.12']
103-
104215 runs-on : ubuntu-latest
105-
106216 steps :
107217 - uses : actions/checkout@v4
108218
@@ -127,9 +237,9 @@ jobs:
127237 working-directory : bindings/python
128238 run : pytest tests/ -v
129239
130- python-tests-macos :
240+ full-python-tests-macos :
241+ needs : [build-and-test, rust-check, python-check, windows-build]
131242 runs-on : macos-latest
132-
133243 steps :
134244 - uses : actions/checkout@v4
135245
@@ -144,22 +254,20 @@ jobs:
144254 run : make extension
145255
146256 - name : Install Python package
147- run : |
148- python3 -m pip install -e "./bindings/python[dev]"
257+ run : python3 -m pip install -e "./bindings/python[dev]"
149258
150259 - name : Run Python tests
151260 working-directory : bindings/python
152261 run : |
153262 SQLITE_PREFIX=$(brew --prefix sqlite)
154263 DYLD_LIBRARY_PATH="$SQLITE_PREFIX/lib:$DYLD_LIBRARY_PATH" python3 -m pytest tests/ -v
155264
156- build-and-test-windows :
265+ full-windows-tests :
266+ needs : [build-and-test, rust-check, python-check, windows-build]
157267 runs-on : windows-latest
158-
159268 defaults :
160269 run :
161270 shell : msys2 {0}
162-
163271 steps :
164272 - uses : actions/checkout@v4
165273
@@ -182,7 +290,6 @@ jobs:
182290 - name : Run functional tests
183291 run : make test-functional
184292
185- # Python binding tests (native Windows Python)
186293 - name : Set up Python
187294 uses : actions/setup-python@v5
188295 with :
@@ -194,7 +301,11 @@ jobs:
194301 pip install -e "./bindings/python[dev]"
195302 cd bindings/python && pytest tests/ -v
196303
197- # Rust binding tests (native Windows Rust)
304+ - name : Copy extension to Rust libs
305+ run : |
306+ mkdir -p bindings/rust/libs
307+ cp build/graphqlite.dll bindings/rust/libs/graphqlite-windows-x86_64.dll
308+
198309 - name : Install Rust toolchain
199310 uses : dtolnay/rust-toolchain@stable
200311
@@ -203,9 +314,14 @@ jobs:
203314 working-directory : bindings/rust
204315 run : cargo test --lib --test integration -- --test-threads=1
205316
317+ # =============================================================================
318+ # Performance Tests - Main branch only
319+ # =============================================================================
320+
206321 performance-tests :
322+ if : github.ref == 'refs/heads/main'
323+ needs : [build-and-test, rust-check, python-check, windows-build]
207324 runs-on : ubuntu-latest
208-
209325 steps :
210326 - uses : actions/checkout@v4
211327
0 commit comments