Skip to content

Commit af3a078

Browse files
authored
feat: GitHub actions (#86)
1 parent 1127adb commit af3a078

File tree

7 files changed

+70
-46
lines changed

7 files changed

+70
-46
lines changed

.github/workflows/build.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
on: [push, pull_request]
2+
name: build
3+
jobs:
4+
build:
5+
name: Run build
6+
runs-on: macos-latest
7+
steps:
8+
- uses: actions/checkout@v2
9+
- name: Flutter action
10+
uses: subosito/flutter-action@v1
11+
with:
12+
channel: 'stable'
13+
- name: Install dependencies
14+
run: flutter pub get
15+
- name: Build apk
16+
run: |
17+
cd example
18+
flutter build apk

.github/workflows/tests.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
on: [push, pull_request]
2+
name: tests
3+
jobs:
4+
build:
5+
name: Run tests
6+
runs-on: macos-latest
7+
steps:
8+
- uses: actions/checkout@v2
9+
- name: Flutter action
10+
uses: subosito/flutter-action@v1
11+
with:
12+
channel: 'stable'
13+
- name: Install dependencies
14+
run: flutter pub get
15+
- name: Run tests
16+
id: test
17+
run: |
18+
cd example
19+
flutter test ..
20+
cd ..
21+
- name: Check format
22+
run: flutter format --dry-run --set-exit-if-changed .
23+
- name: Analyzer
24+
run: flutter analyze --no-pub lib example
25+
- name: Generate coverage
26+
continue-on-error: true
27+
run: flutter test --no-pub --coverage
28+
- name: Upload coverage to Codecov
29+
if: github.ref == 'refs/heads/master' && steps.test.outcome == 'success'
30+
uses: codecov/codecov-action@v1
31+
with:
32+
file: coverage/lcov.info

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ doc/api/
2626
*.js.deps
2727
*.js.map
2828
.vscode/
29+
/coverage/

.travis.yml

-33
This file was deleted.

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<div align="center"><img src="https://github.com/aagarwal1012/IntroViews-Flutter/blob/master/display/header.png?raw=true"/></div>
22
<br/>
33
<div align="center">
4-
<a href="https://flutter.io">
4+
<a href="https://flutter.io">
55
<img src="https://img.shields.io/badge/Platform-Flutter-yellow.svg"
66
alt="Platform" />
77
</a>
8-
<a href="https://pub.dartlang.org/packages/intro_views_flutter">
8+
<a href="https://pub.dartlang.org/packages/intro_views_flutter">
99
<img src="https://img.shields.io/pub/v/intro_views_flutter.svg"
1010
alt="Pub Package" />
1111
</a>
12-
<a href="https://travis-ci.com/aagarwal1012/IntroViews-Flutter">
13-
<img src="https://travis-ci.com/aagarwal1012/IntroViews-Flutter.svg?branch=master"
12+
<img src="https://github.com/aagarwal1012/IntroViews-Flutter/actions/workflows/build.yml/badge.svg"
1413
alt="Build Status" />
15-
</a>
14+
<img src="https://github.com/aagarwal1012/IntroViews-Flutter/actions/workflows/tests.yml/badge.svg"
15+
alt="Tests Status" />
1616
<a href="https://codecov.io/gh/aagarwal1012/IntroViews-Flutter">
1717
<img src="https://codecov.io/gh/aagarwal1012/IntroViews-Flutter/branch/master/graph/badge.svg"
1818
alt="Codecov Coverage" />

lib/UI/page_indicator_buttons.dart

+8-8
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,16 @@ class DefaultButton extends StatelessWidget {
3434
opacity = pageButtonViewModel.slidePercent;
3535
}
3636

37-
return FlatButton(
37+
return TextButton(
3838
onPressed: onTap,
3939
child: Opacity(
4040
opacity: opacity,
4141
child: DefaultTextStyle.merge(
4242
style: style,
4343
child: child,
44-
), //Text
45-
), //Opacity
46-
); //FlatButton
44+
),
45+
),
46+
);
4747
}
4848
}
4949

@@ -75,16 +75,16 @@ class DoneButton extends StatelessWidget {
7575
opacity = 1.0 - pageButtonViewModel.slidePercent;
7676
}
7777

78-
return FlatButton(
78+
return TextButton(
7979
onPressed: onTap,
8080
child: Opacity(
8181
opacity: opacity,
8282
child: DefaultTextStyle.merge(
8383
style: style,
84-
child: child, //Text
84+
child: child,
8585
),
86-
), //Opacity
87-
); //FlatButton
86+
),
87+
);
8888
}
8989
}
9090

test/widget_test.dart

+6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ const double PORTRAIT_WIDTH = 1800.0;
1313
const double PORTRAIT_HEIGHT = 2400.0;
1414

1515
void main() {
16+
testWidgets('Dummy test', (WidgetTester tester) async {
17+
await tester.pumpWidget(App());
18+
await tester.pumpAndSettle();
19+
expect(find.byType(MaterialApp), findsOneWidget);
20+
});
21+
1622
testWidgets('Skip Pressed smoke test', (WidgetTester tester) async {
1723
// Build our app and trigger a frame.
1824
await tester.pumpWidget(new App());

0 commit comments

Comments
 (0)