Repository navigation
191 lines (190 loc) · 7.39 KB
/
Copy pathapple.yml
File metadata and controls
191 lines (190 loc) · 7.39 KB
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
name: Apple
on:
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
- converted_to_draft
paths-ignore:
- docs/**
- website/**
- README.md
- AGENTS.md
- CONTEXT.md
- CONTRIBUTING.md
- LICENSE
- SECURITY.md
push:
branches:
- main
permissions:
contents: read
actions: read
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
smoke-apple-platform:
name: Smoke Tests (${{ matrix.platform }})
strategy:
fail-fast: false
matrix:
platform: [ios, macos]
if: ${{ !github.event.pull_request.draft }}
runs-on: blacksmith-6vcpu-macos-26
timeout-minutes: 90
env:
AGENT_DEVICE_HOME: ${{ runner.temp }}/agent-device-apple-smoke-home
BASE_SHA: ${{ github.event.pull_request.base.sha }}
IOS_STATE_DIR: ${{ github.workspace }}/.tmp/ios-agent-device-state
MACOS_STATE_DIR: ${{ github.workspace }}/.tmp/macos-agent-device-state
IOS_DERIVED_PATH: ${{ github.workspace }}/.tmp/ios-runner-derived
MACOS_DERIVED_PATH: ${{ github.workspace }}/.tmp/macos-runner-derived
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: Setup toolchain
uses: ./.github/actions/setup-node-pnpm
with:
cache-dependency-path: |
pnpm-lock.yaml
examples/test-app/pnpm-lock.yaml
- name: Fetch the PR base for Apple selectors
if: github.event_name == 'pull_request'
shell: bash
run: |
git fetch origin "$BASE_SHA" --depth=1 || echo "Base fetch failed; Apple selection will fail open."
- name: Select iOS smoke tests
id: ios-impact
shell: bash
env:
APPLE_PLATFORM: ${{ matrix.platform }}
run: |
if [ "$APPLE_PLATFORM" = ios ]; then
node --experimental-strip-types scripts/apple-ci-impact.ts smoke
else
echo "run=false" >> "$GITHUB_OUTPUT"
fi
- name: Select macOS smoke tests
id: macos-impact
shell: bash
env:
APPLE_PLATFORM: ${{ matrix.platform }}
run: |
if [ "$APPLE_PLATFORM" = macos ]; then
node --experimental-strip-types scripts/apple-ci-impact.ts macos
else
echo "run=false" >> "$GITHUB_OUTPUT"
fi
- name: Build the shared CLI
id: build
if: steps.ios-impact.outputs.run != 'false' || steps.macos-impact.outputs.run != 'false'
uses: ./.github/actions/run-gate
with:
gate: build
- if: steps.build.outcome == 'success'
run: node --experimental-strip-types scripts/install-workspace-replay-plugins.ts
- name: iOS smoke tests
id: ios
uses: ./.github/actions/smoke-ios-run
continue-on-error: true
timeout-minutes: 80
env:
IOS_RUNTIME_VERSION: '26.2'
IOS_UDID: ${{ vars.IOS_UDID }}
AGENT_DEVICE_STATE_DIR: ${{ env.IOS_STATE_DIR }}
AGENT_DEVICE_IOS_RUNNER_DERIVED_PATH: ${{ env.IOS_DERIVED_PATH }}
AGENT_DEVICE_IOS_PREPARE_TIMEOUT_MS: '420000'
AGENT_DEVICE_XCUITEST_INCLUDE_UNIT_TESTS: '1'
AGENT_DEVICE_XCUITEST_ARCHS: arm64
AGENT_DEVICE_IOS_APP_EVENT_URL_TEMPLATE: agent-device-test-app:///automation?event={event}&payload={payload}
if: ${{ !cancelled() && steps.build.outcome == 'success' && steps.ios-impact.outputs.run != 'false' }}
- name: Clean the iOS host
id: ios-cleanup
if: ${{ always() && steps.build.outcome == 'success' && steps.ios-impact.outputs.run != 'false' }}
continue-on-error: true
env:
AGENT_DEVICE_STATE_DIR: ${{ env.IOS_STATE_DIR }}
shell: bash
run: bash scripts/teardown-ios-smoke.sh
- name: macOS smoke tests
id: macos
uses: ./.github/actions/smoke-macos
continue-on-error: true
timeout-minutes: 80
env:
AGENT_DEVICE_STATE_DIR: ${{ env.MACOS_STATE_DIR }}
AGENT_DEVICE_IOS_RUNNER_DERIVED_PATH: ${{ env.MACOS_DERIVED_PATH }}
AGENT_DEVICE_XCUITEST_INCLUDE_UNIT_TESTS: '1'
RESULT_BUNDLE_PATH: ${{ github.workspace }}/.tmp/xctest-host/RunnerTests.xcresult
RESULT_SUMMARY_PATH: ${{ github.workspace }}/.tmp/xctest-host/test-results-summary.json
XCTEST_LANE: host
if: ${{ !cancelled() && steps.build.outcome == 'success' && steps.macos-impact.outputs.run != 'false' }}
- name: Diagnose the Apple host after a phase failure
if: ${{ always() && (steps.ios.outcome == 'failure' || steps.macos.outcome == 'failure' || steps.ios-cleanup.outcome == 'failure') }}
continue-on-error: true
shell: bash
run: |
mkdir -p test/screenshots
screencapture -x test/screenshots/apple-host-after-failure.png
osascript scripts/decline-hosted-compute-local-network.applescript diagnose
- name: Clean macOS daemon and retained runners
id: macos-cleanup
if: ${{ always() && steps.build.outcome == 'success' && steps.macos-impact.outputs.run != 'false' }}
continue-on-error: true
env:
AGENT_DEVICE_STATE_DIR: ${{ env.MACOS_STATE_DIR }}
shell: bash
run: |
pnpm clean:daemon
- name: Require the selected Apple phases to succeed
if: always()
env:
IOS_SELECTED: ${{ steps.ios-impact.outputs.run }}
IOS_OUTCOME: ${{ steps.ios.outcome }}
MACOS_SELECTED: ${{ steps.macos-impact.outputs.run }}
MACOS_OUTCOME: ${{ steps.macos.outcome }}
IOS_CLEANUP_OUTCOME: ${{ steps.ios-cleanup.outcome }}
MACOS_CLEANUP_OUTCOME: ${{ steps.macos-cleanup.outcome }}
shell: bash
run: |
set -euo pipefail
printf "### Apple smoke phases\n\n| Phase | Outcome |\n| --- | --- |\n| iOS | %s |\n| macOS | %s |\n" "$IOS_OUTCOME" "$MACOS_OUTCOME" >> "$GITHUB_STEP_SUMMARY"
if [ "$IOS_SELECTED" = false ]; then
test "$IOS_OUTCOME" = skipped
test "$IOS_CLEANUP_OUTCOME" = skipped
else
test "$IOS_OUTCOME" = success
test "$IOS_CLEANUP_OUTCOME" = success
fi
if [ "$MACOS_SELECTED" = false ]; then
test "$MACOS_OUTCOME" = skipped
test "$MACOS_CLEANUP_OUTCOME" = skipped
else
test "$MACOS_OUTCOME" = success
test "$MACOS_CLEANUP_OUTCOME" = success
fi
- name: Upload Apple artifacts
if: always()
uses: ./.github/actions/upload-agent-device-artifacts
with:
artifact-name: apple-artifacts-${{ matrix.platform }}
agent-state-dir: ${{ env.IOS_STATE_DIR }}
runner-derived-path: ${{ env.IOS_DERIVED_PATH }}
additional-paths: |
${{ env.MACOS_STATE_DIR }}/daemon.log
${{ env.MACOS_STATE_DIR }}/sessions/**
${{ env.MACOS_DERIVED_PATH }}/.agent-device-runner-cache.json
${{ env.MACOS_DERIVED_PATH }}/Logs/**
smoke-apple:
name: Smoke Tests
if: ${{ always() && !github.event.pull_request.draft }}
needs: smoke-apple-platform
runs-on: blacksmith-2vcpu-ubuntu-2404
steps:
- name: Require both Apple jobs to succeed
env:
RESULT: ${{ needs.smoke-apple-platform.result }}
run: test "$RESULT" = success