Still broken, but can(?) run on web #133
This file contains 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
name: Dart CI | |
on: | |
push: | |
branches: | |
- v3 | |
pull_request: | |
branches: | |
- v3 | |
jobs: | |
version: | |
name: Version Display | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: ${{ vars.FLUTTER_VERSION }} | |
- run: flutter --version | |
format: | |
name: Check formatting | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: ${{ vars.FLUTTER_VERSION }} | |
- name: Check formatting | |
run: dart format --set-exit-if-changed . | |
lint: | |
name: Check lints | |
runs-on: ubuntu-latest | |
if: ${{ false }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: ${{ vars.FLUTTER_VERSION }} | |
- run: flutter pub get | |
working-directory: packages/isar | |
- run: flutter pub get | |
working-directory: packages/isar_flutter_libs | |
- run: flutter pub get | |
working-directory: packages/isar_generator | |
- run: flutter pub get | |
working-directory: packages/isar_inspector | |
- run: flutter pub get | |
working-directory: examples/pub | |
- run: | | |
flutter pub get | |
flutter pub run build_runner build | |
dart tool/generate_all_tests.dart | |
working-directory: packages/isar_test | |
- name: Lint | |
run: flutter analyze | |
test: | |
name: Dart Test | |
strategy: | |
matrix: | |
os: [macos-latest, ubuntu-latest, windows-latest] | |
fail-fast: false | |
runs-on: ${{ matrix.os }} | |
steps: | |
- run: echo "$OSTYPE" | |
- uses: actions/checkout@v4 | |
- uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: ${{ vars.FLUTTER_VERSION }} | |
- name: Prepare Build | |
uses: ./.github/actions/prepare-build | |
- name: Build Isar Core | |
run: sh tool/build.sh | |
- name: Prepare Tests | |
run: sh tool/prepare_tests.sh | |
- name: Run Flutter Unit tests | |
run: flutter test -j 1 | |
working-directory: packages/isar_test | |
valgrind: | |
name: Valgrind | |
runs-on: ubuntu-latest | |
if: ${{ false }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: ${{ vars.FLUTTER_VERSION }} | |
- name: Prepare Build | |
uses: ./.github/actions/prepare-build | |
- name: Install valgrind and llvm | |
run: sudo apt update && sudo apt install -y valgrind libclang-dev | |
- name: Build Isar Core | |
run: sh tool/build.sh | |
- name: Prepare Tests | |
run: sh tool/prepare_tests.sh | |
- name: Run Valgrind | |
run: | | |
dart compile exe integration_test/all_tests.dart | |
valgrind \ | |
--leak-check=full \ | |
--error-exitcode=1 \ | |
--show-mismatched-frees=no \ | |
--show-possibly-lost=no \ | |
--errors-for-leak-kinds=definite \ | |
integration_test/all_tests.exe | |
working-directory: packages/isar_test | |
coverage: | |
name: Code Coverage | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: ${{ vars.FLUTTER_VERSION }} | |
- name: Prepare Build | |
uses: ./.github/actions/prepare-build | |
- name: Build Isar Core | |
run: sh tool/build.sh | |
- name: Prepare Tests | |
run: sh tool/prepare_tests.sh | |
- name: Add packages | |
run: | | |
flutter pub add json_annotation | |
flutter pub add intl | |
flutter pub add isar_test --path ../isar_test | |
working-directory: packages/isar | |
- name: Collect isar Coverage | |
run: | | |
flutter test --coverage --coverage-path lcov_isar.info | |
working-directory: packages/isar | |
- name: Collect isar_test Coverage | |
run: | | |
flutter test --coverage ../isar_test/test --coverage-path lcov_isar_test.info | |
working-directory: packages/isar | |
- name: Upload isar Coverage | |
uses: codecov/codecov-action@v3 | |
with: | |
files: packages/isar/lcov_isar.info | |
- name: Upload isar_test Coverage | |
uses: codecov/codecov-action@v3 | |
with: | |
files: packages/isar/lcov_isar_test.info | |
test_generator: | |
name: Generator Test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: ${{ vars.FLUTTER_VERSION }} | |
- name: Run Generator Unit tests | |
run: | | |
dart pub get | |
dart test | |
working-directory: packages/isar_generator | |
integration_test_ios: | |
name: Integration Test iOS | |
runs-on: macos-12 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Start simulator | |
uses: futureware-tech/simulator-action@v3 | |
with: | |
model: iPhone 13 | |
- uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: ${{ vars.FLUTTER_VERSION }} | |
- name: Prepare Build | |
uses: ./.github/actions/prepare-build | |
- name: Build Isar Core | |
run: | | |
bash tool/build_ios.sh | |
unzip isar_ios.xcframework.zip -d packages/isar_flutter_libs/ios | |
- name: Prepare Tests | |
run: sh tool/prepare_tests.sh | |
- name: Run Flutter Integration tests | |
run: flutter test integration_test/integration_test.dart --dart-define STRESS=true | |
working-directory: packages/isar_test | |
integration_test_android: | |
name: Integration Test Android | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v3 | |
with: | |
java-version: "11" | |
distribution: "zulu" | |
- uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: ${{ vars.FLUTTER_VERSION }} | |
- name: Prepare Build | |
uses: ./.github/actions/prepare-build | |
- name: Build Isar Core | |
run: | | |
bash tool/build_android.sh x64 | |
mkdir -p packages/isar_flutter_libs/android/src/main/jniLibs/x86_64 | |
mv libisar_android_x64.so packages/isar_flutter_libs/android/src/main/jniLibs/x86_64/libisar.so | |
- name: Prepare Tests | |
run: sh tool/prepare_tests.sh | |
- name: Run Flutter Integration tests | |
continue-on-error: true | |
timeout-minutes: ${{ inputs.timeout_minutes }} | |
uses: Wandalen/[email protected] | |
with: | |
action: reactivecircus/android-emulator-runner@v2 | |
with: | | |
api-level: 29 | |
arch: x86_64 | |
profile: pixel | |
working-directory: packages/isar_test | |
script: flutter test integration_test/integration_test.dart --dart-define STRESS=true | |
integration_test_macos: | |
name: Integration Test macOS | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: subosito/flutter-action@v2 | |
with: | |
# flutter-version: "3.3.10" # https://github.com/flutter/flutter/issues/118469 | |
flutter-version: ${{ vars.FLUTTER_VERSION }} | |
- name: Prepare Build | |
uses: ./.github/actions/prepare-build | |
- name: Build Isar Core | |
run: | | |
bash tool/build_macos.sh | |
install_name_tool -id @rpath/libisar.dylib libisar_macos.dylib | |
mv libisar_macos.dylib packages/isar_flutter_libs/macos/libisar.dylib | |
- name: Prepare Tests | |
run: sh tool/prepare_tests.sh | |
- name: Run Flutter Driver tests | |
run: | | |
flutter config --enable-macos-desktop | |
flutter test -d macos integration_test/integration_test.dart --dart-define STRESS=true | |
working-directory: packages/isar_test | |
integration_test_linux: | |
name: Integration Test Linux | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: ${{ vars.FLUTTER_VERSION }} | |
- name: Prepare Build | |
uses: ./.github/actions/prepare-build | |
- name: Install Linux requirements | |
run: sudo apt-get install clang cmake ninja-build pkg-config libgtk-3-dev | |
- name: Setup headless display | |
uses: pyvista/setup-headless-display-action@v1 | |
- name: Build Isar Core | |
run: | | |
bash tool/build_linux.sh x64 | |
mv libisar_linux_x64.so packages/isar_flutter_libs/linux/libisar.so | |
- name: Prepare Tests | |
run: sh tool/prepare_tests.sh | |
- name: Run Flutter Driver tests | |
run: | | |
flutter config --enable-linux-desktop | |
flutter test -d linux integration_test/integration_test.dart --dart-define STRESS=true | |
working-directory: packages/isar_test | |
integration_test_windows: | |
name: Integration Test Windows | |
runs-on: windows-2019 | |
if: ${{ false }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: ${{ vars.FLUTTER_VERSION }} | |
- name: Prepare Build | |
uses: ./.github/actions/prepare-build | |
- name: Build Isar Core | |
run: | | |
bash tool/build_windows.sh x64 | |
mv isar_windows_x64.dll packages/isar_flutter_libs/windows/libisar.dll | |
- name: Prepare Tests | |
run: sh tool/prepare_tests.sh | |
- name: Run Flutter Driver tests | |
run: | | |
flutter config --enable-windows-desktop | |
flutter test -d windows integration_test/integration_test.dart --dart-define STRESS=true | |
working-directory: packages/isar_test | |
drive_chrome: | |
runs-on: ubuntu-latest | |
if: ${{ false }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: ${{ vars.FLUTTER_VERSION }} | |
- name: Install chromedricer | |
uses: nanasess/setup-chromedriver@v1 | |
- name: Prepare chromedricer | |
run: chromedriver --port=4444 & | |
- name: Run Dart tests in browser | |
run: | | |
flutter pub get | |
dart tool/generate_long_double_test.dart | |
dart tool/generate_all_tests.dart | |
flutter pub run build_runner build | |
flutter drive --driver=isar_driver.dart --target=isar_driver_target.dart -d web-server --browser-name chrome | |
working-directory: packages/isar_test | |
drive_safari: | |
runs-on: macos-latest | |
if: ${{ false }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: ${{ vars.FLUTTER_VERSION }} | |
- name: Prepare safaridricer | |
run: | | |
sudo safaridriver --enable | |
safaridriver --port=4444 & | |
- name: Run Dart tests in browser | |
run: | | |
flutter pub get | |
dart tool/generate_long_double_test.dart | |
flutter pub run build_runner build | |
dart tool/generate_all_tests.dart | |
flutter drive --driver=isar_driver.dart --target=isar_driver_target.dart -d web-server --browser-name safari | |
working-directory: packages/isar_test | |
drive_firefox: | |
runs-on: ubuntu-latest | |
if: ${{ false }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: ${{ vars.FLUTTER_VERSION }} | |
- name: Install geckodriver | |
uses: browser-actions/setup-geckodriver@latest | |
- name: Prepare geckodriver | |
run: geckodriver --port=4444 & | |
- name: Run Dart tests in browser | |
run: | | |
flutter pub get | |
dart tool/generate_long_double_test.dart | |
flutter pub run build_runner build | |
dart tool/generate_all_tests.dart | |
flutter drive --driver=isar_driver.dart --target=isar_driver_target.dart -d web-server --browser-name firefox | |
working-directory: packages/isar_test |