Skip to content

Update sqlite3mc to 2.5.0 #1264

Update sqlite3mc to 2.5.0

Update sqlite3mc to 2.5.0 #1264

Workflow file for this run

name: CI
on:
push:
branches: ['**']
pull_request:
branches: [ main ]
permissions: {}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
fetch_sqlite:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository)
uses: ./.github/workflows/compile_sqlite.yml
zizmor:
runs-on: ubuntu-latest
permissions:
security-events: write # To report results
steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
persist-credentials: false
- name: Run zizmor 🌈
uses: zizmorcore/zizmor-action@6fc4b006235f201fdab3722e17240ab420d580e5 # v0.6.1
analyze:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository)
timeout-minutes: 5
strategy:
matrix:
dart: [stable]
name: Analyze ${{ matrix.package }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: dart-lang/setup-dart@v1
with:
sdk: ${{ matrix.dart }}
- uses: actions/cache@v6
with:
path: "${{ env.PUB_CACHE }}"
key: dart-dependencies-${{ matrix.dart }}-${{ runner.os }}
restore-keys: |
dart-dependencies-${{ matrix.dart }}-
dart-dependencies-
- name: Pub get
run: dart pub get
- name: Format dart
run: |
dart format --set-exit-if-changed sqlite3
dart format --set-exit-if-changed sqlite3_test
dart format --set-exit-if-changed sqlite3_web
- name: Format native
run: clang-format --Werror --dry-run --style=google assets/*.h
working-directory: sqlite3
- name: Format native
run: clang-format --Werror --dry-run --style=google src/*{.h,.c}
working-directory: sqlite3_wasm_build
- name: Analyze
run: dart analyze --fatal-infos sqlite3 sqlite3_web sqlite3_test
test:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository)
timeout-minutes: 5
needs: [analyze, fetch_sqlite]
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
dart: [stable, dev]
name: Unit tests with Dart ${{ matrix.dart }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: dart-lang/setup-dart@v1
with:
sdk: ${{ matrix.dart }}
- name: Download compiled sqlite3
uses: actions/download-artifact@v8
with:
artifact-ids: ${{ needs.fetch_sqlite.outputs.artifact_id }}
path: sqlite-compiled
- name: Download connection pool libraries
uses: actions/download-artifact@v8
with:
artifact-ids: ${{ needs.fetch_sqlite.outputs.pool_libs_artifact_id }}
path: sqlite3_connection_pool/lib/src/precompiled/
- name: Download libraries compiled with sanitizers
uses: actions/download-artifact@v8
with:
artifact-ids: ${{ needs.fetch_sqlite.outputs.sanitized_artifact_id }}
path: sqlite-sanitized/
- uses: actions/cache@v6
with:
path: "${{ env.PUB_CACHE }}"
key: dart-dependencies-${{ matrix.dart }}-${{ runner.os }}
restore-keys: |
dart-dependencies-${{ matrix.dart }}-
dart-dependencies-
- name: Get Dart dependencies
run: |
dart pub get
- name: Write asset hashes
run: dart run tool/write_asset_hashes.dart
- name: Prepare for tests with pre-compiled SQLite
run: |
dart run tool/hook_overrides.dart compiled
- name: Test sqlite3 package
run: |
dart test --test-randomize-ordering-seed "random" -P ci
working-directory: sqlite3/
- name: Test sqlite3_connection_pool package
run: |
dart test
working-directory: sqlite3_connection_pool/
- name: Test sqlite3_test package
run: dart test
if: ${{ runner.os != 'windows' }} # TODO: Investigate crashes on Windows
working-directory: sqlite3_test/
- name: Test extension example
run: dart test
working-directory: sqlite3/example/custom_extension
- name: Run tests with AOT executable
run: dart run run.dart
working-directory: native_tests/
- name: Run tests AddressSanitizer and MemorySanitizer
if: runner.os == 'Linux'
# TODO: Running with --sanitizer=tsan seems to be flaky?
run: |
dart run.dart --sanitizer=asan
dart run.dart --sanitizer=msan
working-directory: native_tests/
- name: Enable sqlite3mc
run: |
dart run tool/hook_overrides.dart compiled-ciphers
- name: Test sqlite3 package with sqlite3mc
run: |
dart test --test-randomize-ordering-seed "random" -P ci
working-directory: sqlite3/
- name: Enable sqlcipher
run: |
dart run tool/hook_overrides.dart compiled-sqlcipher
- name: Test sqlite3 package with sqlcipher
run: |
dart test --test-randomize-ordering-seed "random" -P ci
working-directory: sqlite3/
- name: Prepare for tests with system SQLite
run: |
dart run tool/hook_overrides.dart system-os-specific
- name: Test sqlite3 package with system
run: |
dart test --test-randomize-ordering-seed "random" -P ci -P system
working-directory: sqlite3/
- name: Test sqlite3_connection_pool package
run: |
dart test
working-directory: sqlite3_connection_pool/
- name: Test sqlite3_test package
run: dart test
if: ${{ runner.os != 'windows' }} # TODO: Investigate crashes on Windows
working-directory: sqlite3_test/
- name: Web tests
run: |
cp ../sqlite-compiled/*.wasm example/web
dart test -P web -r expanded
# If browsers behave differently on different platforms, surely that's not our fault...
# So, only run browser tests on Linux to be faster.
if: runner.os == 'Linux'
working-directory: sqlite3/
upload_asset_hashes:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository)
timeout-minutes: 5
needs: [test, fetch_sqlite]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: dart-lang/setup-dart@v1
- name: Download compiled sqlite3
uses: actions/download-artifact@v8
with:
artifact-ids: ${{ needs.fetch_sqlite.outputs.artifact_id }}
path: sqlite-compiled
- uses: actions/cache@v6
with:
path: "${{ env.PUB_CACHE }}"
key: dart-dependencies-beta-${{ runner.os }}
restore-keys: |
dart-dependencies-beta-
dart-dependencies-
- name: Get Dart dependencies
run: |
dart pub get
- name: Write asset hashes
run: dart run tool/write_asset_hashes.dart
- name: Upload asset hashes
uses: actions/upload-artifact@v7
id: upload
with:
name: asset-hashes
path: sqlite3/lib/src/hook/asset_hashes.dart
if-no-files-found: error
retention-days: 1
integration_test_web:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository)
timeout-minutes: 10
needs: [analyze, fetch_sqlite]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: dart-lang/setup-dart@v1
- name: Download compiled sqlite3
uses: actions/download-artifact@v8
with:
artifact-ids: ${{ needs.fetch_sqlite.outputs.artifact_id }}
path: sqlite-compiled
- uses: actions/cache@v6
with:
path: "${{ env.PUB_CACHE }}"
key: dart-dependencies-${{ matrix.dart }}-${{ runner.os }}
restore-keys: |
dart-dependencies-${{ matrix.dart }}-
dart-dependencies-
- name: Prepare for tests
run: |
dart run tool/write_asset_hashes.dart
dart run tool/hook_overrides.dart compiled
- name: Copy SQLite libraries
run: |
mkdir sqlite3_web/extra/js-package/assets
cp sqlite-compiled/sqlite3.wasm sqlite3_web/extra/js-package/assets/
cp sqlite-compiled/sqlite3mc.wasm sqlite3_web/extra/js-package/assets/
- name: Setup node
uses: actions/setup-node@v7
with:
node-version: latest
package-manager-cache: false
- name: Install pnpm
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
with:
package_json_file: sqlite3_web/extra/js-package/package.json
- name: Build pnpm package
working-directory: sqlite3_web/extra/js-package
run: |
pnpm build:worker
pnpm node tool/build_worker_testing.js
pnpm build
- name: Web tests
run: |
cp ../sqlite-compiled/*.wasm web/
dart pub get
dart test -P gh_actions -r expanded
working-directory: sqlite3_web
# Shamelessly stolen from https://medium.com/flutter-community/run-flutter-driver-tests-on-github-actions-13c639c7e4ab
integration_test_desktop:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository)
needs: [test, fetch_sqlite]
runs-on: macos-latest
timeout-minutes: 30
steps:
- name: List simulators
if: runner.os == 'macos'
run: "xcrun xctrace list devices"
- name: Start simulator
if: runner.os == 'macos'
run: |
IPHONE=$(xcrun xctrace list devices 2>&1 | grep -m 1 "iPhone" | awk -F'[()]' '{print $4}')
xcrun simctl boot $IPHONE
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2 #v2.23.0
- name: Flutter version
run: flutter --version
- name: Download compiled sqlite3
uses: actions/download-artifact@v8
with:
artifact-ids: ${{ needs.fetch_sqlite.outputs.artifact_id }}
path: sqlite-compiled
- name: Download connection pool libraries
uses: actions/download-artifact@v8
with:
artifact-ids: ${{ needs.fetch_sqlite.outputs.pool_libs_artifact_id }}
path: sqlite3_connection_pool/lib/src/precompiled/
- uses: actions/cache@v6
with:
path: "${{ env.PUB_CACHE }}"
key: dart-dependencies-${{ matrix.dart }}-${{ runner.os }}
restore-keys: |
dart-dependencies-${{ matrix.dart }}-
dart-dependencies-
- name: Write asset hashes
run: |
dart pub get
dart run tool/write_asset_hashes.dart
dart run tool/hook_overrides.dart compiled
- name: Flutter sqlite3 tests on macOS
working-directory: examples/flutter_integration_tests
run: |
flutter config --enable-swift-package-manager
flutter test integration_test
flutter test integration_test -d macos
- name: Enable sqlite3mc
run: |
dart run tool/hook_overrides.dart compiled-ciphers
- name: Flutter sqlite3mc tests on macOS
working-directory: examples/flutter_integration_tests
run: |
flutter config --enable-swift-package-manager
flutter test integration_test -Dsqlite3.multipleciphers=true
flutter test integration_test -Dsqlite3.multipleciphers=true -d macos
- name: Enable sqlcipher
run: |
dart run tool/hook_overrides.dart compiled-sqlcipher
- name: Flutter sqlcipher tests on macOS
working-directory: examples/flutter_integration_tests
run: |
flutter config --enable-swift-package-manager
flutter test integration_test -Dsqlite3.sqlcipher=true
flutter test integration_test -Dsqlite3.sqlcipher=true -d macos
integration_test_android:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository)
needs: [test, fetch_sqlite]
runs-on: ubuntu-latest
timeout-minutes: 30
env:
AVD_NAME: ubuntu-avd-x86_64-34
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2 #v2.23.0
- name: Flutter version
run: flutter --version
- name: Setup runner
# https://github.com/ReactiveCircus/android-emulator-runner?tab=readme-ov-file#usage--examples
run: |
sudo apt-get update
sudo apt-get install -y cmake ninja-build pkg-config libgtk-3-dev libstdc++-12-dev
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: AVD Cache
uses: actions/cache@v6
id: avd-cache
if: runner.os == 'linux'
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-35
- name: Download compiled sqlite3
uses: actions/download-artifact@v8
with:
artifact-ids: ${{ needs.fetch_sqlite.outputs.artifact_id }}
path: sqlite-compiled
- name: Download connection pool libraries
uses: actions/download-artifact@v8
with:
artifact-ids: ${{ needs.fetch_sqlite.outputs.pool_libs_artifact_id }}
path: sqlite3_connection_pool/lib/src/precompiled/
- uses: actions/cache@v6
with:
path: "${{ env.PUB_CACHE }}"
key: dart-dependencies-${{ matrix.dart }}-${{ runner.os }}
restore-keys: |
dart-dependencies-${{ matrix.dart }}-
dart-dependencies-
- name: Write asset hashes
run: |
dart pub get
dart run tool/write_asset_hashes.dart
dart run tool/hook_overrides.dart compiled
- name: Android emulator tests
uses: reactivecircus/android-emulator-runner@e89f39f1abbbd05b1113a29cf4db69e7540cae5a # v2.37.0
with:
api-level: 34
force-avd-creation: false
target: google_apis
arch: x86_64
disable-animations: false
avd-name: $AVD_NAME
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
script: |
dart run tool/hook_overrides.dart compiled
cd examples/flutter_integration_tests && flutter test integration_test
dart run tool/hook_overrides.dart compiled-ciphers
cd examples/flutter_integration_tests && flutter test integration_test
dart run tool/hook_overrides.dart compiled-sqlcipher
cd examples/flutter_integration_tests && flutter test integration_test -Dsqlite3.sqlcipher=true