Skip to content

Instantly share code, notes, and snippets.

View tianhaoz95's full-sized avatar

Tianhao Zhou tianhaoz95

View GitHub Profile
@tianhaoz95
tianhaoz95 / unit_test_and_lint.yml
Created October 12, 2019 06:58
Do Flutter unit test and lint in GitHub Actions
name: Unit test and lint
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 / repo_struct_for_github_actions.txt
Created October 12, 2019 07:03
Repository file structure for GitHub Actions
- repository root
- .github
- ISSUE_TEMPLATE
- PULL_REQUEST_TEMPLATE
- workflows
- action1.yml
- action2.yml
...
- your code
@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_web_config.sh
Created October 16, 2019 18:01
enable Flutter for the web
flutter channel master
flutter config --enable-web
flutter doctor -v
@tianhaoz95
tianhaoz95 / headless_unittest.dart
Created October 16, 2019 18:12
Headless unit test for Flutter
test('Server defaults', () async {
final WebServerDevice device = WebServerDevice();
expect(device.name, 'Headless Server');
expect(device.id, 'headless-server');
expect(device.supportsHotReload, true);
expect(device.supportsHotRestart, true);
expect(device.supportsStartPaused, true);
expect(device.supportsFlutterExit, true);
expect(device.supportsScreenshot, false);
@tianhaoz95
tianhaoz95 / flutter_run_headless_server.sh
Created October 16, 2019 20:24
compile flutter for headless-server
flutter run -d headless-server
@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: