-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
112 lines (108 loc) · 4.11 KB
/
flutter-drive.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# https://medium.com/flutter-community/run-flutter-driver-tests-on-github-actions-13c639c7e4ab
# https://github.com/nazarcybulskij/CI_CD_Flutter_Demo
# https://weilu.blog.csdn.net/article/details/114744416
# Name of your workflow.
name: flutter_deer driver
# Trigger the workflow on push or pull request.
on: [push, pull_request]
# A workflow run is made up of one or more jobs.
jobs:
# id of job, a string that is unique to the "jobs" node above.
drive_ios:
# Creates a build matrix for your jobs. You can define different
# variations of an environment to run each job in.
strategy:
# A set of different configurations of the virtual environment.
matrix:
device:
- "iPhone 8"
- "iPhone 14 Pro Max"
# When set to true, GitHub cancels all in-progress jobs if any matrix job
# fails.
fail-fast: false
# The type of machine to run the job on.
runs-on: macos-latest
# Contains a sequence of tasks.
steps:
# A name for your step to display on GitHub.
# - name: "List all simulators"
# run: "xcrun instruments -s"
# - name: "Start Simulator"
# run: |
# UDID=$(
# xcrun instruments -s |
# awk \
# -F ' *[][]' \
# -v 'device=${{ matrix.device }}' \
# '$1 == device { print $2 }'
# )
# xcrun simctl boot "${UDID:?No Simulator with this name found}"
- name: "Start Simulator"
# https://github.com/futureware-tech/simulator-action
uses: futureware-tech/simulator-action@v2
with:
model: ${{ matrix.device }}
erase_before_boot: true
shutdown_after_job: true
# The branch or tag ref that triggered the workflow will be checked out.
# https://github.com/marketplace/actions/checkout
- uses: actions/checkout@v3
# Sets up a flutter environment.
# https://github.com/marketplace/actions/flutter-action
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.16.0'
channel: 'stable' # or: 'dev' or 'beta'
architecture: x64
- run: "flutter clean"
- name: "Run Flutter Driver tests"
run: "flutter drive --target=test_driver/driver.dart --no-enable-impeller" #https://github.com/flutter/flutter/issues/128391
drive_android:
# The type of machine to run the job on.
runs-on: macos-latest
# creates a build matrix for your jobs
strategy:
# set of different configurations of the virtual environment.
matrix:
api-level: [21, 33]
target: [google_apis]
steps:
- uses: actions/checkout@v3
- name: set up JDK 11
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '11'
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.16.0'
channel: 'stable' # or: 'dev' or 'beta'
architecture: x64
- name: "Run Flutter Driver tests"
# GitHub Action for installing, configuring and running Android Emulators (work only Mac OS)
# https://github.com/marketplace/actions/android-emulator-runner
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
target: ${{ matrix.target }}
arch: x86_64
profile: Nexus 6
script: "flutter drive --target=test_driver/driver.dart"
accessibility_test:
#The type of machine to run the job on. [windows,macos, ubuntu , self-hosted]
runs-on: macos-latest
#sequence of tasks called
steps:
# The branch or tag ref that triggered the workflow will be checked out.
# https://github.com/actions/checkout
- uses: actions/checkout@v3
# Setup a flutter environment.
# https://github.com/marketplace/actions/flutter-action
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.16.0'
channel: 'stable'
architecture: x64
- run: "flutter pub get"
- name: "Run Flutter Accessibility Tests"
run: "flutter test test/accessibility_test.dart"