From 4d62a79e96ad9b9d21a8e90f322ebef2a73d3d2e Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Thu, 8 Oct 2020 12:29:18 +0000 Subject: [PATCH] fix: CI --- .gitlab-ci.yml | 13 ++++++++----- prepare.sh | 6 +++++- pubspec.yaml | 7 ++----- test.sh | 6 +++--- test/fake_database.dart | 2 +- 5 files changed, 19 insertions(+), 15 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5285d35..99a3cd2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,16 +11,19 @@ coverage: dependencies: [] script: - apt update - - apt install -y curl gnupg2 git - - curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - - - curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list + - apt install -y curl gnupg2 git unzip + - git clone https://github.com/flutter/flutter.git -b stable + - export PATH="$PATH:`pwd`/flutter/bin" + - sed -i s/#//g pubspec.yaml + - flutter doctor - apt update - - apt install -y dart chromium lcov libolm3 sqlite3 libsqlite3-dev + - apt install -y chromium lcov libolm3 sqlite3 libsqlite3-dev - ln -s /usr/lib/dart/bin/pub /usr/bin/ - useradd -m test - chown -R 'test:' '.' - chmod +x ./prepare.sh - chmod +x ./test.sh + - rm -r example - su -c ./prepare.sh test - su -c ./test.sh test artifacts: @@ -125,4 +128,4 @@ pages: paths: - public only: - - main \ No newline at end of file + - main diff --git a/prepare.sh b/prepare.sh index e480bfb..a619b42 100644 --- a/prepare.sh +++ b/prepare.sh @@ -20,4 +20,8 @@ cmake --build . cd .. fi -pub get +if which flutter >/dev/null; then + flutter pub get +else + pub get +fi diff --git a/pubspec.yaml b/pubspec.yaml index 2c283e1..8ae05fd 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -30,8 +30,5 @@ dev_dependencies: moor_generator: ^3.0.0 build_runner: ^1.5.2 pedantic: ^1.9.0 - moor_ffi: ^0.5.0 - -dependency_overrides: - # See https://github.com/flutter/flutter/issues/62240 - analyzer: '0.39.14' + #flutter_test: + # sdk: flutter diff --git a/test.sh b/test.sh index f6300dd..0c3f63a 100644 --- a/test.sh +++ b/test.sh @@ -1,6 +1,6 @@ #!/bin/sh -e # pub run test -p vm -pub run test_coverage --print-test-output -pub global activate remove_from_coverage -pub global run remove_from_coverage:remove_from_coverage -f coverage/lcov.info -r '\.g\.dart$' +flutter test --coverage +flutter pub global activate remove_from_coverage +flutter pub global run remove_from_coverage:remove_from_coverage -f coverage/lcov.info -r '\.g\.dart$' genhtml -o coverage coverage/lcov.info || true diff --git a/test/fake_database.dart b/test/fake_database.dart index 7d85757..d270c80 100644 --- a/test/fake_database.dart +++ b/test/fake_database.dart @@ -18,7 +18,7 @@ import 'package:famedlysdk/famedlysdk.dart'; import 'package:moor/moor.dart'; -import 'package:moor_ffi/moor_ffi.dart' as moor; +import 'package:moor/ffi.dart' as moor; Database getDatabase() { moorRuntimeOptions.dontWarnAboutMultipleDatabases = true;