-
Notifications
You must be signed in to change notification settings - Fork 487
172 lines (156 loc) · 4.65 KB
/
extensions-test.yml
File metadata and controls
172 lines (156 loc) · 4.65 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
name: Extensions Tests
on:
push:
branches: [ "main" ]
pull_request:
merge_group:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
PROTOC_VERSION: 3.23.4
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build-libsql:
runs-on: ubuntu-latest
name: Build libsql (shared)
steps:
- uses: hecrj/setup-rust-action@v2
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up cargo cache
uses: Swatinem/rust-cache@v2
- name: build libsql
working-directory: libsql-sqlite3
run: |
./configure
make libsql
- name: build bundled sqlite for ffi
run: |
cargo xtask build-bundled
- name: upload shared build artifacts
uses: actions/upload-artifact@v4
with:
name: libsql-build-output
path: |
libsql-sqlite3/sqlite3.c
libsql-sqlite3/sqlite3.h
libsql-sqlite3/sqlite3ext.h
libsql-ffi/bundled/src/sqlite3.c
libsql-ffi/bundled/src/sqlite3.h
libsql-ffi/bundled/SQLite3MultipleCiphers/src/sqlite3.c
libsql-ffi/bundled/SQLite3MultipleCiphers/src/sqlite3.h
c-tests:
needs: build-libsql
runs-on: ubuntu-latest
defaults:
run:
working-directory: libsql-sqlite3
name: CR SQLite C Tests
steps:
- uses: hecrj/setup-rust-action@v2
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up cargo cache
uses: Swatinem/rust-cache@v2
- name: download shared build artifacts
uses: actions/download-artifact@v4
with:
name: libsql-build-output
path: .
- name: build
run: |
cd ext/crr
make loadable
- name: test
run: |
cd ext/crr
make test
rs-tests:
needs: build-libsql
runs-on: ubuntu-latest
defaults:
run:
working-directory: libsql-sqlite3
name: CR SQLite Rust Tests
steps:
- uses: hecrj/setup-rust-action@v2
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up cargo cache
uses: Swatinem/rust-cache@v2
- name: download shared build artifacts
uses: actions/download-artifact@v4
with:
name: libsql-build-output
path: .
- name: test
run: |
cd ext/crr/rs/core
cargo test --features=loadable_extension
extensions-tests:
needs: build-libsql
runs-on: ubuntu-latest
name: Extensions Tests
steps:
- uses: hecrj/setup-rust-action@v2
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up cargo cache
uses: Swatinem/rust-cache@v2
- name: download shared build artifacts
uses: actions/download-artifact@v4
with:
name: libsql-build-output
path: .
- name: install libs
run: |
sudo apt update
sudo apt install -y libblas-dev liblapack-dev
- name: download extensions
run: |
cd libsql-sqlite3/test/rust_suite
export VSS_VERSION="v0.1.2"
wget https://github.com/asg017/sqlite-vss/releases/download/$VSS_VERSION/sqlite-vss-$VSS_VERSION-loadable-linux-x86_64.tar.gz
tar -xvf sqlite-vss-$VSS_VERSION-loadable-linux-x86_64.tar.gz -C src
- name: test
run: |
cd libsql-sqlite3/test/rust_suite
# Only execute extensions tests
cargo test --features=extensions extensions
cross-platform-build-checks:
name: Cross-platform build checks
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest]
steps:
- uses: hecrj/setup-rust-action@v2
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up cargo cache
uses: Swatinem/rust-cache@v2
- name: setup msys2 for windows
if: matrix.os == 'windows-latest'
uses: msys2/setup-msys2@v2
with:
update: true
install: mingw-w64-x86_64-toolchain make base-devel
msystem: mingw64
path-type: inherit
- name: build libsql on windows
if: matrix.os == 'windows-latest'
shell: msys2 {0}
working-directory: libsql-sqlite3
run: |
sed -i 's/\r$//' configure VERSION
./configure
make liblibsql.la
- name: build libsql on macos
if: matrix.os == 'macos-latest'
working-directory: libsql-sqlite3
run: |
./configure
make libsql