Skip to content

Commit a6a8376

Browse files
author
Ivan Dlugos
committed
CI: build demo applications with flutter
1 parent 43c7500 commit a6a8376

File tree

2 files changed

+42
-9
lines changed

2 files changed

+42
-9
lines changed

.github/workflows/dart.yml

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,10 @@ jobs:
2626
- macos-10.15
2727
- ubuntu-20.04
2828
dart:
29-
# - latest # currently same as the lowest supported
29+
- latest # currently same as the lowest supported
3030
- 2.12.0 # currently the lowest fully supported version (i.e. generator + lib)
3131
runs-on: ${{ matrix.os }}
3232
steps:
33-
# Note: dart-sdk from flutter doesn't work on linux, see https://github.com/flutter/flutter/issues/74599
34-
# - uses: subosito/flutter-action@v1
35-
# with:
36-
# flutter-version: 1.22.x
37-
# - run: flutter --version
3833
- uses: cedx/setup-dart@v2
3934
with:
4035
version: ${{ matrix.dart }}
@@ -50,7 +45,6 @@ jobs:
5045
../tool/pub.sh run build_runner build
5146
../tool/pub.sh run test
5247
53-
5448
valgrind:
5549
runs-on: ubuntu-20.04
5650
container:
@@ -69,3 +63,25 @@ jobs:
6963
../tool/pub.sh get
7064
../tool/pub.sh run build_runner build
7165
./tool/valgrind.sh
66+
67+
flutter-integration-test:
68+
strategy:
69+
fail-fast: false
70+
matrix:
71+
os:
72+
- windows-2019
73+
- macos-10.15
74+
- ubuntu-20.04
75+
channel:
76+
- beta
77+
- stable
78+
runs-on: ${{ matrix.os }}
79+
steps:
80+
- uses: subosito/flutter-action@v1
81+
with:
82+
channel: ${{ matrix.channel }}
83+
- run: echo $PATH
84+
- run: flutter --version
85+
- uses: actions/checkout@v2
86+
- run: make integration-test
87+
working-directory: objectbox

objectbox/tool/integration-test.sh

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
14
. "$(dirname "$0")"/common.sh
25

36
if [[ "$#" -ne "1" ]]; then
@@ -11,5 +14,19 @@ set -x
1114
cd "${root}/$1"
1215
flutter clean
1316
flutter pub get
14-
flutter pub run build_runner build --delete-conflicting-outputs
15-
flutter drive --verbose --target=test_driver/app.dart
17+
18+
# Flutter ~2.0 fails: The pubspec.lock file has changed since the .dart_tool/package_config.json file was generated, please run "pub get" again.
19+
# So we do exactly as suggested... Looks like something to do with path dependency_overrides. Try to remove the workaround with the next stable release.
20+
generateCmd="flutter pub run build_runner build --delete-conflicting-outputs"
21+
$generateCmd || (flutter pub get && $generateCmd)
22+
23+
# flutter drive is currently not available in GitHub Actions (TODO start an emulator/simulator?)
24+
if [[ "${GITHUB_ACTIONS:-}" == "" ]]; then
25+
flutter drive --verbose --target=test_driver/app.dart
26+
fi
27+
28+
flutter build apk
29+
flutter build appbundle
30+
if [[ "$(uname)" == "Darwin" ]]; then
31+
flutter build ios --no-codesign
32+
fi

0 commit comments

Comments
 (0)