Skip to content

Allow disabling bigints #1090

Allow disabling bigints

Allow disabling bigints #1090

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@v6
with:
persist-credentials: false
- name: Run zizmor 🌈
uses: zizmorcore/zizmor-action@b1d7e1fb5de872772f31590499237e7cce841e8e # v0.5.3
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@v6
with:
persist-credentials: false
- uses: dart-lang/setup-dart@v1
with:
sdk: ${{ matrix.dart }}
- uses: actions/cache@v5
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@v6
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@v5
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'
run: |
dart run.dart --sanitizer=asan
dart run.dart --sanitizer=msan
dart run.dart --sanitizer=tsan
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: Prepare for tests with system SQLite
run: |
dart run tool/hook_overrides.dart system-os-specific
- 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: 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@v6
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@v5
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@v6
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@v5
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: Web tests
run: |
cp ../sqlite-compiled/*.wasm web/
dart pub get
dart test -P gh_actions -r expanded
working-directory: sqlite3_web
# The integration tests for android are currently broken (the emulator doesn't want to
# start up...)
#
# integration_test_android:
# runs-on: macos-latest
# needs: [test]
# strategy:
# matrix:
# test:
# - flutter_libs
# - sqlcipher_flutter
# steps:
# - uses: actions/checkout@v6
# - uses: subosito/flutter-action@v2
# with:
# channel: dev
# - name: pub get
# working-directory: "integration_tests/${{ matrix.test }}"
# run: flutter pub get
#
# - name: run tests
# uses: reactivecircus/android-emulator-runner@v2
# with:
# api-level: 29
# script: flutter test integration_test
# working-directory: "integration_tests/${{ matrix.test }}"
# Shamelessly stolen from https://medium.com/flutter-community/run-flutter-driver-tests-on-github-actions-13c639c7e4ab
integration_test:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository)
strategy:
matrix:
runner: [ubuntu-latest, macos-latest]
needs: [test, fetch_sqlite]
runs-on: ${{ matrix.runner }}
timeout-minutes: 30
env:
AVD_NAME: ubuntu-avd-x86_64-34
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@v6
with:
persist-credentials: false
- uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2 #v2.23.0
- name: Flutter version
run: flutter --version
- name: Setup runner
if: runner.os == 'linux'
# 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@v5
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@v5
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
if: runner.os == '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: Flutter sqlite3 tests on Linux
if: false # runner.os == 'linux' currently broken in ci, can't reproduce locally or in Ubuntu VM
working-directory: examples/flutter_integration_tests
run: |
flutter test integration_test -d linux
- name: SQLite Android emulator tests
uses: reactivecircus/android-emulator-runner@e89f39f1abbbd05b1113a29cf4db69e7540cae5a # v2.37.0
if: runner.os == 'linux'
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: flutter test integration_test
working-directory: "examples/flutter_integration_tests"
- name: Enable sqlite3mc
run: |
dart run tool/hook_overrides.dart compiled-ciphers
- name: Flutter sqlite3mc tests on macOS
if: runner.os == '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: sqlite3mc Android emulator tests
uses: reactivecircus/android-emulator-runner@e89f39f1abbbd05b1113a29cf4db69e7540cae5a # v2.37.0
if: runner.os == 'linux'
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: flutter test integration_test -Dsqlite3.multipleciphers=true
working-directory: "examples/flutter_integration_tests"