Skip to content

Commit

Permalink
feat: CI setting for mono-repo
Browse files Browse the repository at this point in the history
  • Loading branch information
abc873693 committed Oct 2, 2024
1 parent b4b9cc1 commit d22f6d1
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 25 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/ci.workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ jobs:
channel: 'stable'
cache: true
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:'
- run: flutter pub get
- name: Model test
run: flutter test test/model_test.dart
- name: 'Bootstrap package'
run: melos bootstrap --scope tests
- name: Run Test
run: melos run test --no-select
- name: Analyze files
run: flutter analyze .
run: melos run analyze-ci
- name: Build Web
run: flutter build web
working-directory: ./example
Expand Down
23 changes: 22 additions & 1 deletion melos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,25 @@ scripts:
exec: dart analyze .
clean:
run: |
melos clean
melos clean
fix:
run: |
melos exec -c 1 -- \
dart fix --apply
description: |
Run `dart fix --apply` in all packages.
analyze-ci:
run: |
melos exec -c 1 -- \
dart analyze . --fatal-infos
description: |
Run `dart analyze` in all packages.
- Note: you can also rely on your IDEs Dart Analysis / Issues window.
test:
run: |
melos exec -c 6 --fail-fast -- \
"flutter test"
description: Run `flutter test` for a specific package.
packageFilters:
dirExists:
- test
20 changes: 0 additions & 20 deletions packages/ap_common_plugin/test/ap_common_plugin_test.dart
Original file line number Diff line number Diff line change
@@ -1,23 +1,3 @@
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:ap_common_plugin/ap_common_plugin.dart';

void main() {
const MethodChannel channel = MethodChannel('ap_common_plugin');

TestWidgetsFlutterBinding.ensureInitialized();

setUp(() {
channel.setMockMethodCallHandler((MethodCall methodCall) async {
return '42';
});
});

tearDown(() {
channel.setMockMethodCallHandler(null);
});

test('getPlatformVersion', () async {
expect(await ApCommonPlugin.platformVersion, '42');
});
}

0 comments on commit d22f6d1

Please sign in to comment.