Skip to content

Commit 9228984

Browse files
abueideclaude
andauthored
chore(ci): add E2E timing instrumentation and Gradle config cache (#53)
Wraps E2E test steps with timing capture so duration is recorded even on failure. Each workflow now writes a timing.json artifact and outputs a timing table to the GitHub job summary. Also adds ~/.gradle/configuration-cache to Gradle cache paths for faster Android builds. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 8a19c48 commit 9228984

3 files changed

Lines changed: 95 additions & 2 deletions

File tree

.github/workflows/e2e-android.yml

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ jobs:
5656
path: |
5757
~/.gradle/caches
5858
~/.gradle/wrapper
59+
~/.gradle/configuration-cache
5960
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
6061
restore-keys: |
6162
${{ runner.os }}-gradle-
@@ -83,14 +84,44 @@ jobs:
8384
run: devbox run bash ../../plugins/tests/android/test-apk-detection.sh
8485

8586
- name: Run Android E2E test
87+
id: e2e
8688
working-directory: examples/android
8789
env:
8890
BOOT_TIMEOUT: ${{ inputs.boot-timeout }}
8991
TEST_TIMEOUT: ${{ inputs.test-timeout }}
9092
ANDROID_DEFAULT_DEVICE: ${{ matrix.device }}
9193
ANDROID_DEVICES: ${{ matrix.device }}
9294
TEST_TUI: false
93-
run: devbox run --pure -e EMU_HEADLESS=1 -e ANDROID_DEVICES=${{ matrix.device }} test:e2e
95+
run: |
96+
START=$SECONDS
97+
set +e
98+
devbox run --pure -e EMU_HEADLESS=1 -e ANDROID_DEVICES=${{ matrix.device }} test:e2e
99+
E2E_EXIT=$?
100+
set -e
101+
echo "e2e_duration=$(( SECONDS - START ))" >> "$GITHUB_OUTPUT"
102+
exit $E2E_EXIT
103+
104+
- name: Write timing summary
105+
if: always()
106+
run: |
107+
DURATION="${{ steps.e2e.outputs.e2e_duration }}"
108+
RESULT="${{ steps.e2e.outcome }}"
109+
DEVICE="${{ matrix.device }}"
110+
MINUTES=$(( ${DURATION:-0} / 60 ))
111+
SECS=$(( ${DURATION:-0} % 60 ))
112+
113+
mkdir -p examples/android/reports
114+
cat > examples/android/reports/timing.json <<TJSON
115+
{"platform":"android","device":"${DEVICE}","e2e_seconds":${DURATION:-0},"result":"${RESULT}","run_id":"${{ github.run_id }}"}
116+
TJSON
117+
118+
echo "## Android E2E Timing - ${DEVICE}" >> "$GITHUB_STEP_SUMMARY"
119+
echo "" >> "$GITHUB_STEP_SUMMARY"
120+
echo "| Metric | Value |" >> "$GITHUB_STEP_SUMMARY"
121+
echo "|--------|-------|" >> "$GITHUB_STEP_SUMMARY"
122+
echo "| Device | ${DEVICE} |" >> "$GITHUB_STEP_SUMMARY"
123+
echo "| E2E duration | ${MINUTES}m ${SECS}s |" >> "$GITHUB_STEP_SUMMARY"
124+
echo "| Result | ${RESULT} |" >> "$GITHUB_STEP_SUMMARY"
94125
95126
- name: Upload reports and logs
96127
if: always()

.github/workflows/e2e-ios.yml

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,44 @@ jobs:
7777
run: bash scripts/dev/rewrite-plugin-urls.sh --to-local examples/
7878

7979
- name: Run iOS E2E test
80+
id: e2e
8081
working-directory: examples/ios
8182
env:
8283
BOOT_TIMEOUT: ${{ inputs.boot-timeout }}
8384
TEST_TIMEOUT: ${{ inputs.test-timeout }}
8485
IOS_DEFAULT_DEVICE: ${{ matrix.device }}
8586
IOS_DEVICES: ${{ matrix.device }}
8687
TEST_TUI: false
87-
run: devbox run --pure -e SIM_HEADLESS=1 -e IOS_DEVICES=${{ matrix.device }} test:e2e
88+
run: |
89+
START=$SECONDS
90+
set +e
91+
devbox run --pure -e SIM_HEADLESS=1 -e IOS_DEVICES=${{ matrix.device }} test:e2e
92+
E2E_EXIT=$?
93+
set -e
94+
echo "e2e_duration=$(( SECONDS - START ))" >> "$GITHUB_OUTPUT"
95+
exit $E2E_EXIT
96+
97+
- name: Write timing summary
98+
if: always()
99+
run: |
100+
DURATION="${{ steps.e2e.outputs.e2e_duration }}"
101+
RESULT="${{ steps.e2e.outcome }}"
102+
DEVICE="${{ matrix.device }}"
103+
MINUTES=$(( ${DURATION:-0} / 60 ))
104+
SECS=$(( ${DURATION:-0} % 60 ))
105+
106+
mkdir -p examples/ios/reports
107+
cat > examples/ios/reports/timing.json <<TJSON
108+
{"platform":"ios","device":"${DEVICE}","e2e_seconds":${DURATION:-0},"result":"${RESULT}","run_id":"${{ github.run_id }}"}
109+
TJSON
110+
111+
echo "## iOS E2E Timing - ${DEVICE}" >> "$GITHUB_STEP_SUMMARY"
112+
echo "" >> "$GITHUB_STEP_SUMMARY"
113+
echo "| Metric | Value |" >> "$GITHUB_STEP_SUMMARY"
114+
echo "|--------|-------|" >> "$GITHUB_STEP_SUMMARY"
115+
echo "| Device | ${DEVICE} |" >> "$GITHUB_STEP_SUMMARY"
116+
echo "| E2E duration | ${MINUTES}m ${SECS}s |" >> "$GITHUB_STEP_SUMMARY"
117+
echo "| Result | ${RESULT} |" >> "$GITHUB_STEP_SUMMARY"
88118
89119
- name: Upload reports and logs
90120
if: always()

.github/workflows/e2e-react-native.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ jobs:
4949
path: |
5050
~/.gradle/caches
5151
~/.gradle/wrapper
52+
~/.gradle/configuration-cache
5253
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
5354
restore-keys: |
5455
${{ runner.os }}-gradle-
@@ -105,15 +106,46 @@ jobs:
105106
run: bash scripts/dev/rewrite-plugin-urls.sh --to-local examples/
106107

107108
- name: Run React Native E2E test
109+
id: e2e
108110
working-directory: examples/react-native
109111
run: |
112+
START=$SECONDS
113+
set +e
110114
if [ "${{ matrix.platform }}" = "android" ]; then
111115
devbox run --pure -e IOS_SKIP_SETUP=1 -e EMU_HEADLESS=1 -e ANDROID_DEVICES=${{ matrix.device }} test:e2e:android
112116
elif [ "${{ matrix.platform }}" = "ios" ]; then
113117
devbox run --pure -e ANDROID_SKIP_SETUP=1 -e SIM_HEADLESS=1 -e IOS_DEVICES=${{ matrix.device }} test:e2e:ios
114118
elif [ "${{ matrix.platform }}" = "web" ]; then
115119
devbox run --pure -e ANDROID_SKIP_SETUP=1 -e IOS_SKIP_SETUP=1 test:e2e:web
116120
fi
121+
E2E_EXIT=$?
122+
set -e
123+
echo "e2e_duration=$(( SECONDS - START ))" >> "$GITHUB_OUTPUT"
124+
exit $E2E_EXIT
125+
126+
- name: Write timing summary
127+
if: always()
128+
run: |
129+
DURATION="${{ steps.e2e.outputs.e2e_duration }}"
130+
RESULT="${{ steps.e2e.outcome }}"
131+
PLATFORM="${{ matrix.platform }}"
132+
DEVICE="${{ matrix.device }}"
133+
MINUTES=$(( ${DURATION:-0} / 60 ))
134+
SECS=$(( ${DURATION:-0} % 60 ))
135+
136+
mkdir -p examples/react-native/reports
137+
cat > examples/react-native/reports/timing-${PLATFORM}.json <<TJSON
138+
{"platform":"react-native-${PLATFORM}","device":"${DEVICE}","e2e_seconds":${DURATION:-0},"result":"${RESULT}","run_id":"${{ github.run_id }}"}
139+
TJSON
140+
141+
echo "## React Native E2E Timing - ${PLATFORM}-${DEVICE}" >> "$GITHUB_STEP_SUMMARY"
142+
echo "" >> "$GITHUB_STEP_SUMMARY"
143+
echo "| Metric | Value |" >> "$GITHUB_STEP_SUMMARY"
144+
echo "|--------|-------|" >> "$GITHUB_STEP_SUMMARY"
145+
echo "| Platform | ${PLATFORM} |" >> "$GITHUB_STEP_SUMMARY"
146+
echo "| Device | ${DEVICE} |" >> "$GITHUB_STEP_SUMMARY"
147+
echo "| E2E duration | ${MINUTES}m ${SECS}s |" >> "$GITHUB_STEP_SUMMARY"
148+
echo "| Result | ${RESULT} |" >> "$GITHUB_STEP_SUMMARY"
117149
118150
- name: Upload reports and logs
119151
if: always()

0 commit comments

Comments
 (0)