Skip to content

Commit 698ebd1

Browse files
Fishbowlerclaude
andcommitted
ci: auto-update drivers on main instead of blocking PRs
Replace the "Check Drivers Up-to-Date" PR gate with an "Update Drivers" workflow that builds and commits fresh drivers automatically after every merge to main that touches driver source or committed artefacts. update-drivers.yaml (replaces check-drivers.yaml): - Triggers on push to main with path filters covering both source and artefact files; if wrong artefacts land on main via any route (e.g. a contributor with a different local toolchain), CI rebuilds and overwrites them with canonical versions - Builds Android and iOS drivers and commits the artefacts back with [skip ci] to prevent re-triggering - Concurrency group with cancel-in-progress: false serialises runs so no update is lost if two merges land close together - workflow_dispatch rebuilds everything unconditionally - changes job short-circuits on workflow_dispatch to avoid running paths-filter unnecessarily; downstream jobs stay simple with no always() gymnastics test-e2e.yaml: - Add explicit "Build Android drivers" and "Build iOS drivers" steps (renamed from "Build xctest-runner") so E2E runs always exercise freshly-built local drivers Note: maestro-client's checkAndroidApksFresh Gradle task and the maestro-android-source.sha256 sentinel file are now vestigial — they enforced the old "contributors must commit fresh APKs" contract that CI now handles automatically. Cleanup is a follow-up. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 7cd8817 commit 698ebd1

3 files changed

Lines changed: 129 additions & 111 deletions

File tree

.github/workflows/check-drivers.yaml

Lines changed: 0 additions & 110 deletions
This file was deleted.

.github/workflows/test-e2e.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,10 @@ jobs:
165165
java-version: ${{ matrix.java-version }}
166166
cache: gradle
167167

168-
- name: Build xctest-runner
168+
- name: Build Android drivers
169+
run: ./gradlew :maestro-android:assemble :maestro-android:assembleAndroidTest
170+
171+
- name: Build iOS drivers
169172
if: runner.os == 'macOS'
170173
run: ./maestro-ios-xctest-runner/build-maestro-ios-runner.sh | xcbeautify
171174

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
name: Update Drivers
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'maestro-ios-xctest-runner/**'
9+
- 'maestro-android/**'
10+
# Artefact paths: if wrong artefacts land on main via any route (e.g. a
11+
# contributor with a different local toolchain), this triggers a CI
12+
# rebuild that overwrites them with the canonical versions. The bot's
13+
# [skip ci] commit prevents re-triggering.
14+
- 'maestro-client/src/main/resources/maestro-app.apk'
15+
- 'maestro-client/src/main/resources/maestro-server.apk'
16+
- 'maestro-client/src/main/resources/maestro-android-source.sha256'
17+
- 'maestro-ios-driver/src/main/resources/**'
18+
workflow_dispatch: {}
19+
20+
concurrency:
21+
group: update-drivers
22+
cancel-in-progress: false
23+
24+
jobs:
25+
changes:
26+
runs-on: ubuntu-latest
27+
outputs:
28+
android: ${{ steps.dispatch.outputs.android || steps.filter.outputs.android }}
29+
ios: ${{ steps.dispatch.outputs.ios || steps.filter.outputs.ios }}
30+
steps:
31+
# On workflow_dispatch we want to rebuild everything regardless of what
32+
# changed, so the first step short-circuits by writing 'true' for all
33+
# outputs and the remaining steps are skipped. On push, the normal
34+
# paths-filter runs instead. Keeping the logic here means the downstream
35+
# jobs stay simple — they just check needs.changes.outputs.X == 'true'
36+
# with no always() gymnastics.
37+
- name: Run all on workflow_dispatch
38+
id: dispatch
39+
if: github.event_name == 'workflow_dispatch'
40+
run: |
41+
echo "android=true" >> $GITHUB_OUTPUT
42+
echo "ios=true" >> $GITHUB_OUTPUT
43+
- uses: actions/checkout@v6
44+
if: github.event_name != 'workflow_dispatch'
45+
- uses: dorny/paths-filter@v4
46+
id: filter
47+
if: github.event_name != 'workflow_dispatch'
48+
with:
49+
filters: |
50+
android:
51+
- 'maestro-android/**'
52+
- 'maestro-client/src/main/resources/maestro-app.apk'
53+
- 'maestro-client/src/main/resources/maestro-server.apk'
54+
- 'maestro-client/src/main/resources/maestro-android-source.sha256'
55+
ios:
56+
- 'maestro-ios-xctest-runner/**'
57+
- 'maestro-ios-driver/src/main/resources/**'
58+
59+
update-android-driver:
60+
name: Update Android Driver
61+
needs: changes
62+
if: needs.changes.outputs.android == 'true'
63+
runs-on: ubuntu-latest
64+
permissions:
65+
contents: write
66+
67+
steps:
68+
- uses: actions/checkout@v6
69+
70+
- name: Set up Java
71+
uses: actions/setup-java@v5
72+
with:
73+
distribution: zulu
74+
java-version: 17
75+
cache: gradle
76+
77+
- name: Build Android drivers
78+
run: ./gradlew :maestro-android:assemble :maestro-android:assembleAndroidTest
79+
80+
- name: Commit and push updated drivers
81+
run: |
82+
git config user.name "github-actions[bot]"
83+
git config user.email "github-actions[bot]@users.noreply.github.com"
84+
git add \
85+
maestro-client/src/main/resources/maestro-app.apk \
86+
maestro-client/src/main/resources/maestro-server.apk \
87+
maestro-client/src/main/resources/maestro-android-source.sha256
88+
if git diff --cached --quiet; then
89+
echo "Android drivers unchanged — nothing to commit"
90+
exit 0
91+
fi
92+
git commit -m "chore: update Android driver APKs [skip ci]"
93+
git pull --rebase origin main
94+
git push
95+
96+
update-ios-driver:
97+
name: Update iOS Driver
98+
needs: changes
99+
if: needs.changes.outputs.ios == 'true'
100+
runs-on: macos-26
101+
timeout-minutes: 30
102+
permissions:
103+
contents: write
104+
105+
steps:
106+
- uses: actions/checkout@v6
107+
108+
- name: Select Xcode 26.2
109+
run: sudo xcode-select -s /Applications/Xcode_26.2.app/Contents/Developer
110+
111+
- name: Build iOS drivers
112+
run: sh maestro-ios-xctest-runner/build-maestro-ios-runner-all.sh
113+
114+
- name: Commit and push updated drivers
115+
run: |
116+
git config user.name "github-actions[bot]"
117+
git config user.email "github-actions[bot]@users.noreply.github.com"
118+
git add maestro-ios-driver/src/main/resources/
119+
if git diff --cached --quiet; then
120+
echo "iOS drivers unchanged — nothing to commit"
121+
exit 0
122+
fi
123+
git commit -m "chore: update iOS driver [skip ci]"
124+
git pull --rebase origin main
125+
git push

0 commit comments

Comments
 (0)