Skip to content

Instantly share code, notes, and snippets.

View tianhaoz95's full-sized avatar

Tianhao Zhou tianhaoz95

View GitHub Profile
@tianhaoz95
tianhaoz95 / github_action_build_ios.yml
Created October 12, 2019 07:18
Build Flutter iOS app
name: Android build check
on: [push, pull_request]
jobs:
build-Android:
name: Build Android apk
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
with:
name: iOS build check
on: [push, pull_request]
jobs:
build-iOS:
name: Build iOS package
runs-on: macOS-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
with:
@tianhaoz95
tianhaoz95 / all_in_one_flutter_check.yml
Created October 12, 2019 07:29
all in one check for flutter
name: Checkin
on: [push, pull_request]
jobs:
lint-and-test:
name: Test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
@tianhaoz95
tianhaoz95 / flutter_checkin_checks.yml
Created October 17, 2019 06:22
Flutter checkin checks
name: Checkin checks
on:
push:
branches:
- "master"
- "dev/*"
paths:
- "iwfpapp/**"
- ".github/**"
pull_request:
@tianhaoz95
tianhaoz95 / flutter_merge_checks.yml
Created October 17, 2019 06:29
Flutter merge checks
name: Merge
on:
pull_request:
branches:
- "master"
jobs:
build-doc:
name: Build docs
runs-on: ubuntu-latest
steps:
@tianhaoz95
tianhaoz95 / flutter_build_artifact.yml
Created October 17, 2019 06:32
Flutter build artifact
name: Upload build artifact
on:
push:
branches:
- "master"
- "actions/*"
paths:
- "iwfpapp/**"
- ".github/**"
jobs:
@tianhaoz95
tianhaoz95 / flutter_deploy_docs.yml
Created October 17, 2019 06:35
Flutter deploy docs
name: Documentation
on:
push:
branches:
- "master"
jobs:
deploy:
name: Generate documentation
runs-on: ubuntu-latest
steps:
@tianhaoz95
tianhaoz95 / basic_widget_test.dart
Created October 23, 2019 19:37
Basic widget testing
class MyWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'demo',
home: Scaffold(
appBar: AppBar(
title: Text('demo title'),
),
body: Center(
@tianhaoz95
tianhaoz95 / setup.dart
Created October 24, 2019 02:26
Demo app setup
/// main.dart (the entry point to the demo app)
import 'package:flutter/material.dart';
import 'package:demo_async_test/contrib.dart';
import 'package:demo_async_test/slow.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
@tianhaoz95
tianhaoz95 / test.dart
Created October 24, 2019 02:33
demo widget tests
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:demo_async_test/main.dart';
void main() {
testWidgets('Counter increments', (WidgetTester tester) async {
await tester.pumpWidget(MyApp());
expect(find.text('0'), findsOneWidget);
await tester.tap(find.byIcon(Icons.add));