Skip to content

Commit d2df9cc

Browse files
committed
chore(CI): device log artifacts, soft-fail retries, bump deps
- emulator and simulator logging is captured and uploaded as workflow artifact - all soft-fails (e.g., steps susceptible to transient network errors) are retried - cancel action can work inside a workflow run vs as a separate step - bump checkout version
1 parent 8564cbc commit d2df9cc

File tree

4 files changed

+97
-21
lines changed

4 files changed

+97
-21
lines changed

.github/workflows/firebase_remote_config.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
runs-on: macos-latest
2222
timeout-minutes: 30
2323
steps:
24-
- uses: actions/checkout@v1
24+
- uses: actions/checkout@v2
2525
with:
2626
fetch-depth: 0
2727
- name: "Install Flutter"
@@ -43,7 +43,7 @@ jobs:
4343
runs-on: macos-latest
4444
timeout-minutes: 35
4545
steps:
46-
- uses: actions/checkout@v1
46+
- uses: actions/checkout@v2
4747
with:
4848
fetch-depth: 0
4949
- name: "Install Flutter"

.github/workflows/firebase_storage.yaml

+86-16
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010
- master
1111
paths-ignore:
1212
- "docs/**"
13+
- "**/*.md"
1314

1415
env:
1516
FLUTTERFIRE_PLUGIN_SCOPE: "*firebase_storage*"
@@ -21,15 +22,33 @@ jobs:
2122
runs-on: macos-latest
2223
timeout-minutes: 30
2324
steps:
24-
- uses: actions/checkout@v1
25+
- uses: styfle/[email protected]
26+
with:
27+
access_token: ${{ github.token }}
28+
- uses: actions/checkout@v2
2529
with:
2630
fetch-depth: 0
2731
- name: "Install Flutter"
28-
run: ./.github/workflows/scripts/install-flutter.sh dev
32+
uses: nick-invision/retry@v2
33+
with:
34+
timeout_minutes: 10
35+
retry_wait_seconds: 60
36+
max_attempts: 3
37+
command: ./.github/workflows/scripts/install-flutter.sh dev
2938
- name: "Install Tools"
30-
run: ./.github/workflows/scripts/install-tools.sh
39+
uses: nick-invision/retry@v2
40+
with:
41+
timeout_minutes: 10
42+
retry_wait_seconds: 60
43+
max_attempts: 3
44+
command: ./.github/workflows/scripts/install-tools.sh
3145
- name: "Build Example"
32-
run: ./.github/workflows/scripts/build-example.sh android
46+
uses: nick-invision/retry@v2
47+
with:
48+
timeout_minutes: 10
49+
retry_wait_seconds: 60
50+
max_attempts: 3
51+
command: ./.github/workflows/scripts/build-example.sh android
3352
- name: "Drive Example"
3453
uses: reactivecircus/android-emulator-runner@v2
3554
with:
@@ -40,41 +59,92 @@ jobs:
4059
target: default
4160
profile: Nexus 5X
4261
script: ./.github/workflows/scripts/drive-example.sh android
62+
- name: Compress Emulator Log
63+
if: always()
64+
run: gzip -9 adb-log.txt
65+
shell: bash
66+
- name: Upload Emulator Log
67+
uses: actions/upload-artifact@v2
68+
if: always()
69+
with:
70+
name: adb_logs
71+
path: adb-log.txt.gz
4372

4473
apple:
4574
runs-on: macos-latest
4675
timeout-minutes: 35
4776
steps:
48-
- uses: actions/checkout@v1
77+
- uses: styfle/[email protected]
78+
with:
79+
access_token: ${{ github.token }}
80+
- uses: actions/checkout@v2
4981
with:
5082
fetch-depth: 0
5183
- name: "Install Flutter"
52-
run: ./.github/workflows/scripts/install-flutter.sh dev
84+
uses: nick-invision/retry@v2
85+
with:
86+
timeout_minutes: 10
87+
retry_wait_seconds: 60
88+
max_attempts: 3
89+
command: ./.github/workflows/scripts/install-flutter.sh dev
5390
- name: "Install Tools"
54-
run: |
55-
./.github/workflows/scripts/install-tools.sh
56-
flutter config --enable-macos-desktop
91+
uses: nick-invision/retry@v2
92+
with:
93+
timeout_minutes: 10
94+
retry_wait_seconds: 60
95+
max_attempts: 3
96+
command: ./.github/workflows/scripts/install-tools.sh && flutter config --enable-macos-desktop
5797
- name: "Build iOS Example"
58-
run: ./.github/workflows/scripts/build-example.sh ios
98+
uses: nick-invision/retry@v2
99+
with:
100+
timeout_minutes: 10
101+
retry_wait_seconds: 60
102+
max_attempts: 3
103+
command: ./.github/workflows/scripts/build-example.sh ios
59104
- name: "Drive iOS Example"
60105
run: ./.github/workflows/scripts/drive-example.sh ios
106+
- name: Compress Simulator Log
107+
if: always()
108+
run: gzip -9 simulator.log
109+
- name: Upload Simulator Log
110+
uses: actions/upload-artifact@v2
111+
if: always()
112+
with:
113+
name: simulator_logs
114+
path: simulator.log.gz
61115
- name: "Build MacOS Example"
62-
run: ./.github/workflows/scripts/build-example.sh macos
116+
uses: nick-invision/retry@v2
117+
with:
118+
timeout_minutes: 10
119+
retry_wait_seconds: 60
120+
max_attempts: 3
121+
command: ./.github/workflows/scripts/build-example.sh macos
63122
- name: "Drive MacOS Example"
64123
run: ./.github/workflows/scripts/drive-example.sh macos
65124

66125
web:
67126
runs-on: ubuntu-latest
68127
timeout-minutes: 15
69128
steps:
70-
- uses: actions/checkout@v1
129+
- uses: styfle/[email protected]
130+
with:
131+
access_token: ${{ github.token }}
132+
- uses: actions/checkout@v2
71133
with:
72134
fetch-depth: 0
73135
- name: "Install Flutter"
74-
run: ./.github/workflows/scripts/install-flutter.sh beta
136+
uses: nick-invision/retry@v2
137+
with:
138+
timeout_minutes: 10
139+
retry_wait_seconds: 60
140+
max_attempts: 3
141+
command: ./.github/workflows/scripts/install-flutter.sh beta
75142
- name: "Install Tools"
76-
run: |
77-
./.github/workflows/scripts/install-tools.sh
78-
flutter config --enable-web
143+
uses: nick-invision/retry@v2
144+
with:
145+
timeout_minutes: 10
146+
retry_wait_seconds: 60
147+
max_attempts: 3
148+
command: ./.github/workflows/scripts/install-tools.sh && flutter config --enable-web
79149
- name: "Drive Example"
80150
run: ./.github/workflows/scripts/drive-example.sh web

.github/workflows/pr_title.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ jobs:
1111
validate:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: amannn/action-semantic-pull-request@v1.2.0
14+
- uses: amannn/action-semantic-pull-request@v2.1.0
1515
env:
1616
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

.github/workflows/scripts/drive-example.sh

+8-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ if [ "$ACTION" == "android" ]
66
then
77
# Sleep to allow emulator to settle.
88
sleep 15
9+
10+
# Create an emulator log for troubleshooting, will be uploaded as an artifact
11+
nohup sh -c "$ANDROID_HOME/platform-tools/adb logcat '*:D' > adb-log.txt" &
12+
913
melos exec -c 1 --fail-fast --scope="$FLUTTERFIRE_PLUGIN_SCOPE_EXAMPLE" --dir-exists=test_driver -- \
1014
flutter drive --no-pub --target=./test_driver/MELOS_PARENT_PACKAGE_NAME_e2e.dart --dart-define=CI=true
1115
exit
@@ -19,8 +23,10 @@ then
1923
xcrun simctl logverbose "$SIMULATOR" enable
2024
# Sleep to allow simulator to settle.
2125
sleep 15
22-
# Uncomment following line to have simulator logs printed out for debugging purposes.
23-
# xcrun simctl spawn booted log stream --predicate 'eventMessage contains "flutter"' &
26+
27+
# Create a simulator log for troubleshooting, will be uploaded as an artifact
28+
nohup sh -c "sleep 30 && xcrun simctl spawn booted log stream --level debug --style compact > simulator.log 2>&1 &"
29+
2430
melos exec -c 1 --fail-fast --scope="$FLUTTERFIRE_PLUGIN_SCOPE_EXAMPLE" --dir-exists=test_driver -- \
2531
flutter drive -d \"$SIMULATOR\" --no-pub --target=./test_driver/MELOS_PARENT_PACKAGE_NAME_e2e.dart --dart-define=CI=true
2632
MELOS_EXIT_CODE=$?

0 commit comments

Comments
 (0)