@@ -16,7 +16,38 @@ concurrency:
1616 cancel-in-progress : true
1717
1818jobs :
19+ build-libsql :
20+ runs-on : ubuntu-latest
21+ name : Build libsql (shared)
22+
23+ steps :
24+ - uses : hecrj/setup-rust-action@v2
25+ - name : Checkout repository
26+ uses : actions/checkout@v3
27+ - name : Set up cargo cache
28+ uses : Swatinem/rust-cache@v2
29+ - name : build libsql
30+ working-directory : libsql-sqlite3
31+ run : |
32+ ./configure
33+ make libsql
34+ - name : build bundled sqlite for ffi
35+ run : |
36+ cargo xtask build-bundled
37+ - name : upload shared build artifacts
38+ uses : actions/upload-artifact@v4
39+ with :
40+ name : libsql-build-output
41+ path : |
42+ libsql-sqlite3/sqlite3.c
43+ libsql-sqlite3/sqlite3.h
44+ libsql-ffi/bundled/src/sqlite3.c
45+ libsql-ffi/bundled/src/sqlite3.h
46+ libsql-ffi/bundled/SQLite3MultipleCiphers/src/sqlite3.c
47+ libsql-ffi/bundled/SQLite3MultipleCiphers/src/sqlite3.h
48+
1949 c-tests :
50+ needs : build-libsql
2051 runs-on : ubuntu-latest
2152 defaults :
2253 run :
@@ -27,10 +58,13 @@ jobs:
2758 - uses : hecrj/setup-rust-action@v2
2859 - name : Checkout repository
2960 uses : actions/checkout@v3
30- - name : build libsql
31- run : |
32- ./configure
33- make libsql
61+ - name : Set up cargo cache
62+ uses : Swatinem/rust-cache@v2
63+ - name : download shared build artifacts
64+ uses : actions/download-artifact@v4
65+ with :
66+ name : libsql-build-output
67+ path : .
3468 - name : build
3569 run : |
3670 cd ext/crr
4175 make test
4276
4377 rs-tests :
78+ needs : build-libsql
4479 runs-on : ubuntu-latest
4580 defaults :
4681 run :
@@ -51,29 +86,38 @@ jobs:
5186 - uses : hecrj/setup-rust-action@v2
5287 - name : Checkout repository
5388 uses : actions/checkout@v3
54- - name : build libsql
55- run : |
56- ./configure
57- make libsql
89+ - name : Set up cargo cache
90+ uses : Swatinem/rust-cache@v2
91+ - name : download shared build artifacts
92+ uses : actions/download-artifact@v4
93+ with :
94+ name : libsql-build-output
95+ path : .
5896 - name : test
5997 run : |
6098 cd ext/crr/rs/core
6199 cargo test --features=loadable_extension
62100
63101 extensions-tests :
102+ needs : build-libsql
64103 runs-on : ubuntu-latest
65104 name : Extensions Tests
66105
67106 steps :
68107 - uses : hecrj/setup-rust-action@v2
69108 - name : Checkout repository
70109 uses : actions/checkout@v3
110+ - name : Set up cargo cache
111+ uses : Swatinem/rust-cache@v2
112+ - name : download shared build artifacts
113+ uses : actions/download-artifact@v4
114+ with :
115+ name : libsql-build-output
116+ path : .
71117 - name : install libs
72118 run : |
73- sudo apt install libblas-dev liblapack-dev
74- - name : build libsql and ffi bindings
75- run : |
76- cargo xtask build-bundled
119+ sudo apt update
120+ sudo apt install -y libblas-dev liblapack-dev
77121 - name : download extensions
78122 run : |
79123 cd libsql-sqlite3/test/rust_suite
@@ -85,3 +129,42 @@ jobs:
85129 cd libsql-sqlite3/test/rust_suite
86130 # Only execute extensions tests
87131 cargo test --features=extensions extensions
132+
133+ cross-platform-build-checks :
134+ name : Cross-platform build checks
135+ runs-on : ${{ matrix.os }}
136+ strategy :
137+ fail-fast : false
138+ matrix :
139+ os : [macos-latest, windows-latest]
140+
141+ steps :
142+ - uses : hecrj/setup-rust-action@v2
143+ - name : Checkout repository
144+ uses : actions/checkout@v3
145+ - name : Set up cargo cache
146+ uses : Swatinem/rust-cache@v2
147+
148+ - name : setup msys2 for windows
149+ if : matrix.os == 'windows-latest'
150+ uses : msys2/setup-msys2@v2
151+ with :
152+ update : true
153+ install : mingw-w64-x86_64-toolchain make base-devel
154+ msystem : mingw64
155+ path-type : inherit
156+
157+ - name : build libsql on windows
158+ if : matrix.os == 'windows-latest'
159+ shell : msys2 {0}
160+ working-directory : libsql-sqlite3
161+ run : |
162+ ./configure
163+ make libsql
164+
165+ - name : build libsql on macos
166+ if : matrix.os == 'macos-latest'
167+ working-directory : libsql-sqlite3
168+ run : |
169+ ./configure
170+ make libsql
0 commit comments