Skip to content

Commit

Permalink
Merge pull request #9 from TomFern/main
Browse files Browse the repository at this point in the history
Update README, tweak the pipeline.
  • Loading branch information
joshuadeguzman authored Jul 29, 2021
2 parents bb3ef97 + 6a65a50 commit 53e7ba8
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 34 deletions.
42 changes: 11 additions & 31 deletions .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ blocks:
- checkout
- 'cache restore flutter-packages-$SEMAPHORE_GIT_BRANCH-$(checksum pubspec.yaml),flutter-packages-$(checksum pubspec.yaml),flutter-packages'
- flutter pub get flutter-packages
- 'cache store flutter-packages-$SEMAPHORE_GIT_BRANCH-$(checksum pubspec.yaml),flutter-packages-$(checksum pubspec.yaml),flutter-packages .packages'
- 'cache store flutter-packages-$SEMAPHORE_GIT_BRANCH-$(checksum pubspec.yaml),flutter-packages-$(checksum pubspec.yaml),flutter-packages /root/.pub-cache'
- name: Linting
task:
jobs:
Expand Down Expand Up @@ -45,44 +45,24 @@ blocks:
jobs:
- name: Add New Item Test
commands:
- sdkmanager "platform-tools" "platforms;android-29" "build-tools;30.0.0" "emulator"
- sdkmanager "system-images;android-29;google_apis;x86"
- echo no | avdmanager create avd -n test-emulator -k "system-images;android-29;google_apis;x86"
- emulator -avd test-emulator -noaudio -no-boot-anim -gpu off -no-window &
- 'adb wait-for-device shell ''while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done;'''
- adb shell wm dismiss-keyguard
- sleep 1
- adb shell settings put global window_animation_scale 0
- adb shell settings put global transition_animation_scale 0
- adb shell settings put global animator_duration_scale 0
- flutter test integration_test/add_new_todo_item_test.dart
- name: Edit Existing Item Test
commands:
- sdkmanager "platform-tools" "platforms;android-29" "build-tools;30.0.0" "emulator"
- sdkmanager "system-images;android-29;google_apis;x86"
- echo no | avdmanager create avd -n test-emulator -k "system-images;android-29;google_apis;x86"
- emulator -avd test-emulator -noaudio -no-boot-anim -gpu off -no-window &
- 'adb wait-for-device shell ''while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done;'''
- adb shell wm dismiss-keyguard
- sleep 1
- adb shell settings put global window_animation_scale 0
- adb shell settings put global transition_animation_scale 0
- adb shell settings put global animator_duration_scale 0
- flutter test integration_test/edit_existing_item_test.dart
- name: Delete Existing Item Test
commands:
- sdkmanager "platform-tools" "platforms;android-29" "build-tools;30.0.0" "emulator"
- sdkmanager "system-images;android-29;google_apis;x86"
- echo no | avdmanager create avd -n test-emulator -k "system-images;android-29;google_apis;x86"
- emulator -avd test-emulator -noaudio -no-boot-anim -gpu off -no-window &
- 'adb wait-for-device shell ''while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done;'''
- adb shell wm dismiss-keyguard
- sleep 1
- adb shell settings put global window_animation_scale 0
- adb shell settings put global transition_animation_scale 0
- adb shell settings put global animator_duration_scale 0
- flutter test integration_test/delete_existing_item_test.dart
prologue:
commands:
- checkout
- 'cache restore flutter-packages-$SEMAPHORE_GIT_BRANCH-$(checksum pubspec.yaml),flutter-packages-$(checksum pubspec.yaml),flutter-packages'
- sdkmanager "platform-tools" "platforms;android-29" "build-tools;30.0.0" "emulator"
- sdkmanager "system-images;android-29;google_apis;x86"
- echo no | avdmanager create avd -n test-emulator -k "system-images;android-29;google_apis;x86"
- emulator -avd test-emulator -noaudio -no-boot-anim -gpu off -no-window &
- 'adb wait-for-device shell ''while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done;'''
- adb shell wm dismiss-keyguard
- sleep 1
- adb shell settings put global window_animation_scale 0
- adb shell settings put global transition_animation_scale 0
- adb shell settings put global animator_duration_scale 0
9 changes: 9 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
MIT License

Copyright (c) 2021 Rendered Text

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 changes: 28 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# semaphoreci_flutter_demo
# Flutter 2.0 Test Demo

[![Build Status](https://semaphore-demos.semaphoreci.com/badges/semaphore-demo-flutter2/branches/master.svg?style=shields)](https://semaphore-demos.semaphoreci.com/projects/semaphore-demo-flutter2) [![style: very good analysis](https://img.shields.io/badge/style-very_good_analysis-B22C89.svg)](https://pub.dev/packages/very_good_analysis)
[![Build Status](https://semaphore-demos.semaphoreci.com/badges/semaphore-demo-flutter2/branches/master.svg)](https://semaphore-demos.semaphoreci.com/projects/semaphore-demo-flutter2) [![style: very good analysis](https://img.shields.io/badge/style-very_good_analysis-B22C89.svg)](https://pub.dev/packages/very_good_analysis)

Example repository showcasing a pipeline with different kinds of tests for a Flutter 2.0 application.

## Versions

Expand Down Expand Up @@ -52,4 +54,27 @@ For example, adding new item in the list
flutter test integration_test/add_new_todo_item_test.dart
```

See [integration_test](https://github.com/joshuamdeguzman/semaphoreci_flutter_demo)s for the list of available integration tests.
See [integration_tests](https://github.com/semaphoreci-demos/semaphore-demo-flutter2/tree/main/integration_test) for the list of available integration tests.

## Continuous Integration

The demo includes a working [Semaphore][semaphore] CI in the `main` branch. Fork this repository and use it to [create your own project][create-project] on Semaphore.

The CI pipeline will look like this:

![](./public/pipeline.png)

The example pipeline contains 4 blocks.

1. Install and cache Flutter dependencies.
2. Run Linting and code analysis tests.
3. Run unit and widget tests.
4. Run integration tests on an emulator.

## License

Copyright (c) 2021 Rendered Text

Distributed under the MIT License. See the file LICENSE.

[semaphore]: https://semaphoreci.com
Binary file added public/pipeline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 53e7ba8

Please sign in to comment.