Skip to content
代码片段 群组 项目
提交 7c327a26 编辑于 作者: Neil Wang's avatar Neil Wang 提交者: xin fan
浏览文件

ci: #92 Build CI Environment

上级 107d5e95
No related branches found
No related tags found
无相关合并请求
image: cirrusci/flutter
stages: stages:
- check - check
- deploy
code_quality:
stage: check
before_script:
- flutter pub global activate flutter_analyze_reporter
- export PATH="$PATH:$HOME/.pub-cache/bin"
script:
- flutter pub get
- flutter_analyze_reporter --output=report.json --reporter=gitlab
artifacts:
reports:
codequality: report.json
check: check:
stage: check stage: check
script: script:
- echo "Hello" - sh ./scripts/check-all
coverage: '/lines\.*: \d+\.\d+\%/'
artifacts:
name: "test-coverage-report-$CI_COMMIT_SHORT_SHA"
paths:
- coverage
expire_in: 5 days
build-android:
extends: check
stage: deploy
script:
- flutter build apk
# - 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file build/app/outputs/flutter-apk/app-release.apk "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/demo/0.0.1/app-release.apk"'
build-ios:
extends: check
stage: deploy
script:
# - flutter build ipa
- echo "Hello World."
name: test_app name: jihu_gitlab_app
description: A new Flutter project. description: A new Flutter project.
# The following line prevents the package from being accidentally published to # The following line prevents the package from being accidentally published to
......
#!/usr/bin/env sh
rm -rf ./coverage
flutter pub get
flutter analyze --no-fatal-infos
flutter test --coverage
lcov -r coverage/lcov.info '*/__test*__/*' -o coverage/lcov_cleaned.info
genhtml coverage/lcov_cleaned.info --output=coverage
import 'package:flutter_test/flutter_test.dart';
import 'package:jihu_gitlab_app/main.dart' as root;
void main() {
test('Should run app main', () {
root.main();
});
}
...@@ -7,8 +7,7 @@ ...@@ -7,8 +7,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_test/flutter_test.dart';
import 'package:jihu_gitlab_app/main.dart';
import 'package:test_app/main.dart';
void main() { void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async { testWidgets('Counter increments smoke test', (WidgetTester tester) async {
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册