File tree 2 files changed +29
-25
lines changed
2 files changed +29
-25
lines changed Original file line number Diff line number Diff line change
1
+ name : Flutter CI
2
+ on :
3
+ pull_request :
4
+ push :
5
+ branches :
6
+ - main
7
+
8
+ jobs :
9
+ build :
10
+ runs-on : ubuntu-latest
11
+ steps :
12
+ - uses : actions/checkout@v2
13
+ - uses : actions/setup-java@v2
14
+ with :
15
+ distribution : ' zulu'
16
+ java-version : ' 11'
17
+ - uses : subosito/flutter-action@v1
18
+ - name : Get dependencies
19
+ run : flutter pub get
20
+ - name : Check code format
21
+ run : flutter format --set-exit-if-changed .
22
+ - name : Run linter
23
+ run : flutter analyze .
24
+ - name : Run tests
25
+ run : flutter test
26
+ - name : Generate android APK
27
+ run : flutter build apk
Original file line number Diff line number Diff line change 1
- // This is a basic Flutter widget test.
2
- //
3
- // To perform an interaction with a widget in your test, use the WidgetTester
4
- // utility that Flutter provides. For example, you can send tap and scroll
5
- // gestures. You can also use WidgetTester to find child widgets in the widget
6
- // tree, read text, and verify that the values of widget properties are correct.
7
-
8
- import 'package:flutter/material.dart' ;
9
1
import 'package:flutter_test/flutter_test.dart' ;
10
2
11
- import 'package:flutter_template/main.dart' ;
12
-
13
3
void main () {
14
- testWidgets ('Counter increments smoke test' , (WidgetTester tester) async {
15
- // Build our app and trigger a frame.
16
- await tester.pumpWidget (const MyApp ());
17
-
18
- // Verify that our counter starts at 0.
19
- expect (find.text ('0' ), findsOneWidget);
20
- expect (find.text ('1' ), findsNothing);
21
-
22
- // Tap the '+' icon and trigger a frame.
23
- await tester.tap (find.byIcon (Icons .add));
24
- await tester.pump ();
25
-
26
- // Verify that our counter has incremented.
27
- expect (find.text ('0' ), findsNothing);
28
- expect (find.text ('1' ), findsOneWidget);
4
+ testWidgets ('Example test' , (WidgetTester tester) async {
5
+ expect (0 , 0 );
29
6
});
30
7
}
You can’t perform that action at this time.
0 commit comments