-
Notifications
You must be signed in to change notification settings - Fork 11
84 lines (70 loc) · 2.58 KB
/
tests.yml
File metadata and controls
84 lines (70 loc) · 2.58 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
on:
push:
pull_request:
name: "tests"
jobs:
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 }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, macos-latest]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: dart-lang/setup-dart@v1
- 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-04-15
components: rust-src,rustfmt,clippy
- name: Check formatting
run: cargo fmt --all --check
- name: Build
run: |
# Need a debug build for the dart tests
cargo build -p powersync_loadable
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 --features loadable_extension
- 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()"
- uses: actions/cache@v4
id: sqlite_build
with:
path: dart/.dart_tool/sqlite3/
key: ${{ runner.os }}-${{ hashFiles('dart/tool/') }}
- name: Setup Dart tests
working-directory: dart
run: |
dart pub get
dart run tool/download_sqlite3.dart
dart analyze
- name: Dart tests on Linux
if: runner.os == 'Linux'
working-directory: dart
run: |
CORE_TEST_SQLITE=.dart_tool/sqlite3/latest/libsqlite3.so dart test
CORE_TEST_SQLITE=.dart_tool/sqlite3/minimum/libsqlite3.so dart test
- name: Dart tests on macOS
if: runner.os == 'macOS'
working-directory: dart
# We skip sync_local_performance_test on macOS because the runners are just so slow...
run: |
CORE_TEST_SQLITE=.dart_tool/sqlite3/latest/libsqlite3.dylib dart test -P skip_slow
CORE_TEST_SQLITE=.dart_tool/sqlite3/minimum/libsqlite3.dylib dart test -P skip_slow