feat: checkpoint requests #1028
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| on: | |
| push: | |
| pull_request: | |
| name: "tests" | |
| permissions: {} | |
| concurrency: | |
| group: packages-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| zizmor: | |
| permissions: | |
| security-events: write # Needed to upload findings as code scanning results. | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| persist-credentials: false | |
| - name: Run zizmor 🌈 | |
| uses: zizmorcore/zizmor-action@5f14fd08f7cf1cb1609c1e344975f152c7ee938d # v0.5.6 | |
| with: | |
| persona: pedantic | |
| 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@v6 | |
| with: | |
| persist-credentials: false | |
| - 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@v6 | |
| with: | |
| persist-credentials: false | |
| - 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@v6 | |
| with: | |
| persist-credentials: false | |
| - 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@v6 | |
| with: | |
| persist-credentials: false | |
| - 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@v6 | |
| with: | |
| persist-credentials: false | |
| - 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@v6 | |
| with: | |
| persist-credentials: false | |
| - 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@v6 | |
| with: | |
| persist-credentials: false | |
| - name: Ubuntu setup | |
| if: matrix.os == 'ubuntu-24.04' | |
| run: | | |
| sudo apt install libreadline-dev | |
| - name: Install Rust Nightly | |
| run: rustup install | |
| - 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@v6 | |
| with: | |
| persist-credentials: false | |
| - uses: dart-lang/setup-dart@v1 | |
| - name: Setup Dart tests | |
| working-directory: dart | |
| run: | | |
| dart pub get | |
| dart analyze | |
| - uses: actions/cache@v5 | |
| 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@v8 | |
| with: | |
| name: linux-library | |
| path: dart/assets | |
| - name: Download libs | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: macos-library | |
| path: dart/assets | |
| - name: Download libs | |
| uses: actions/download-artifact@v8 | |
| 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@v6 | |
| with: | |
| persist-credentials: false | |
| - uses: dart-lang/setup-dart@v1 | |
| - name: Install Rust Stable | |
| run: rustup install stable | |
| - name: Setup Dart tests | |
| working-directory: dart | |
| run: | | |
| dart pub get | |
| dart analyze | |
| - uses: actions/cache@v5 | |
| 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 | |
| test_with_sanitizers: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| persist-credentials: false | |
| - uses: dart-lang/setup-dart@v1 | |
| - name: Install Rust Nightly | |
| run: rustup install | |
| - name: Install LLVM toolchain | |
| run: | | |
| sudo apt update | |
| sudo apt install -y llvm clang lld | |
| - name: Build with sanitizers | |
| run: tool/build_linux_sanitized.sh | |
| - run: dart pub get | |
| working-directory: dart | |
| - name: Test with MemorySanitizer | |
| working-directory: dart | |
| run: dart tool/run_tests.dart msan | |
| - name: Test with AddressSanitizer | |
| working-directory: dart | |
| run: dart tool/run_tests.dart asan |