Skip to content

Better cache key

Better cache key #715

Workflow file for this run

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
with:
submodules: true
- name: Build Android
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
with:
submodules: true
- 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
with:
submodules: true
- 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
with:
submodules: true
- 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
with:
submodules: true
- 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
with:
submodules: true
- 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
with:
submodules: true
- 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()"
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
with:
submodules: true
- uses: dart-lang/setup-dart@v1
- uses: actions/cache@v4
id: sqlite_build
with:
path: dart/.dart_tool/sqlite3/
key: ${{ matrix.os }}-${{ hashFiles('dart/tool/') }}
- name: Setup Dart tests
working-directory: dart
run: |
dart pub get
dart run tool/download_sqlite3.dart
dart analyze
- 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 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
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
with:
submodules: true
- 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 --features loadable_extension