117 lines (117 loc) · 3.62 KB
/
thor.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
113
114
115
116
117
name: thor
on:
push:
paths:
- .github/workflows/thor.yml
branches:
- "master"
- "actions/android-integration-test__*"
- "actions/ios-integration-test__*"
- "integration/android__*"
pull_request:
branches:
- "master"
schedule:
- cron: 0 2 * * *
jobs:
android-integration-test:
name: run integration test on Android emulator
runs-on: macos-latest
# TODO(tianhaoz95): re-enable this once integration test works.
if: false
strategy:
matrix:
device:
- "pixel_xl"
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: '8.x'
- uses: subosito/flutter-action@v1
with:
flutter-version: '2.0.3'
channel: 'stable'
- name: run tests
timeout-minutes: 30
uses: reactivecircus/android-emulator-runner@v2.15.0
env:
ANDROID_SIGN_PWD: ${{ secrets.ANDROID_SIGN_PWD }}
SECRET_REPO: ${{ secrets.SECRET_REPO }}
GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }}
with:
api-level: 29
profile: ${{ matrix.device }}
script: |
/Users/runner/Library/Android/sdk/tools/bin/avdmanager list
sleep 20
./scripts/setenv.sh
flutter doctor -v
cd ./photochatapp && export ANDROID_DEBUG=true && flutter pub get && flutter drive --target=test_driver/app.dart --no-sound-null-safety
- name: upload screenshot
uses: actions/upload-artifact@master
with:
name: online_screenshot_${{ matrix.device }}
path: /tmp/iwfpapp_screenshot
ios-integration-test:
name: run integration test on iOS emulator
runs-on: macos-latest
# TODO(tianhaoz95): re-enable this once integration test works.
if: false
strategy:
matrix:
device:
- "iPad Pro (12.9-inch) (4th generation) (13.7)"
- "iPhone 11 Pro Max (13.7)"
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: '12.x'
- uses: subosito/flutter-action@v1
with:
flutter-version: '1.20.1'
channel: 'stable'
- name: upgrade flutter
run: |
flutter channel master
flutter upgrade
- 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: run integration tests
timeout-minutes: 30
env:
ANDROID_SIGN_PWD: ${{ secrets.ANDROID_SIGN_PWD }}
SECRET_REPO: ${{ secrets.SECRET_REPO }}
GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }}
run: |
./scripts/setenv.sh
cd ./photochatapp
flutter doctor -v
flutter pub get
xcrun simctl io booted recordVideo recording.mov &
sleep 5
export RECORDING_PID=${!}
echo "Recording process up with pid: ${RECORDING_PID}"
flutter drive --target=test_driver/app.dart
sleep 5
kill -SIGINT $RECORDING_PID
sleep 10
cp recording.mov /tmp/iwfpapp_screenshot
- name: upload screenshot
uses: actions/upload-artifact@master
with:
name: online_screenshot_${{ matrix.device }}
path: /tmp/iwfpapp_screenshot