-
Notifications
You must be signed in to change notification settings - Fork 11
216 lines (183 loc) · 6.43 KB
/
tests.yml
File metadata and controls
216 lines (183 loc) · 6.43 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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
on:
push:
pull_request:
name: "tests"
jobs:
libs_linux:
name: Building Linux libraries
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build Linux libraries
uses: ./.github/actions/linux
libs_macos:
name: Building macOS libraries
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository)
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Build macOS
uses: ./.github/actions/macos
libs_windows:
name: Building Windows libraries
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository)
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Build Windows
uses: ./.github/actions/windows
libs_android:
name: Building Android libraries
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build Android
uses: ./.github/actions/android
with:
sign-publication: '0'
libs_wasm:
name: Basic WASM build
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build wasm
uses: ./.github/actions/wasm
libs_xcframework:
name: Build XCFramework
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository)
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Build XCFramework
uses: ./.github/actions/xcframework
rust_unit_tests:
name: Rust unit tests on ${{ matrix.os }}
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository)
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, macos-latest]
steps:
- uses: actions/checkout@v4
- name: Ubuntu setup
if: matrix.os == 'ubuntu-24.04'
run: |
sudo apt install libreadline-dev
- name: Install Rust Nightly
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly-2025-10-31
components: rust-src,rustfmt,clippy
- name: Check formatting
run: cargo fmt --all --check
- name: Build
run: |
cargo build -p powersync_loadable --release
cargo build -p powersync_core --release --features static
cargo build -p powersync_sqlite --release
cargo build -p sqlite3 --release
- name: Test powersync
run: |
cargo test -p powersync_core
- name: Check shell
run: |
./target/release/powersync_sqlite ":memory:" "select powersync_rs_version()"
- name: Check loadable extension
run: |
./target/release/sqlite3 ":memory:" ".load ./target/release/libpowersync" "select powersync_rs_version()"
build:
name: Testing on ${{ matrix.os }}
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository)
runs-on: ${{ matrix.os }}
needs: [libs_linux, libs_macos, libs_windows]
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, ubuntu-arm64, macos-latest, windows-latest, windows-11-arm]
steps:
- uses: actions/checkout@v4
- uses: dart-lang/setup-dart@v1
- name: Setup Dart tests
working-directory: dart
run: |
dart pub get
dart analyze
- uses: actions/cache@v4
with:
path: dart/.dart_tool/hooks_runner/
key: hooks-${{ matrix.os }}-${{ hashFiles('dart/pubspec.lock') }}
restore-keys: hooks-${{ matrix.os }}
- name: Download libs
uses: actions/download-artifact@v5
with:
name: linux-library
path: dart/assets
- name: Download libs
uses: actions/download-artifact@v5
with:
name: macos-library
path: dart/assets
- name: Download libs
uses: actions/download-artifact@v5
with:
name: windows-library
path: dart/assets
- name: View downloaded artifacts
if: runner.os == 'Linux'
working-directory: dart
run: |
ls -al assets/
- name: Dart tests
working-directory: dart
run: |
dart test -P ci
build_stable_rust:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dart-lang/setup-dart@v1
- name: Install Rust Stable
uses: dtolnay/rust-toolchain@stable
- name: Setup Dart tests
working-directory: dart
run: |
dart pub get
dart analyze
- uses: actions/cache@v4
with:
path: dart/.dart_tool/hooks_runner/
key: hooks-${{ matrix.os }}-${{ hashFiles('dart/pubspec.lock') }}
restore-keys: hooks-${{ matrix.os }}
- name: Compile with stable Rust
run: |
cargo +stable build -p powersync_loadable
- name: Dart tests with stable Rust
working-directory: dart
run: dart test
valgrind:
name: Testing with Valgrind on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository)
strategy:
matrix:
include:
- os: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust Nightly
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly-2025-10-31
components: rust-src
- name: Install valgrind
run: sudo apt update && sudo apt install -y valgrind
- name: Install Cargo Valgrind
run: |
cargo install cargo-valgrind
- name: Test Core
run: |
cargo valgrind test -p powersync_core