-
-
Notifications
You must be signed in to change notification settings - Fork 397
185 lines (174 loc) · 6.35 KB
/
Copy pathui-tests.yml
File metadata and controls
185 lines (174 loc) · 6.35 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
name: UI Tests
on:
push:
branches:
- main
- v8.x
pull_request:
types: [opened, synchronize, reopened, labeled]
# Concurrency configuration:
# - We use workflow-specific concurrency groups to prevent multiple UI test runs on the same code,
# as UI tests are resource-intensive and long-running operations.
# - For pull requests, we cancel in-progress runs when new commits are pushed to provide faster
# feedback and avoid wasting expensive UI testing resources on outdated code.
# - For main branch pushes, we never cancel UI tests to ensure complete validation of the user
# interface before the code reaches production, maintaining our quality standards.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
ready-to-merge-gate:
name: Ready-to-merge gate
uses: ./.github/workflows/ready-to-merge-workflow.yml
files-changed:
name: Detect File Changes
runs-on: ubuntu-latest
needs: ready-to-merge-gate
outputs:
run_ui_tests_for_prs: ${{ steps.changes.outputs.run_ui_tests_for_prs }}
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- name: Get changed files
id: changes
uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
with:
token: ${{ github.token }}
filters: .github/file-filters.yml
ui-tests:
if: github.event_name != 'pull_request' || needs.files-changed.outputs.run_ui_tests_for_prs == 'true'
needs: files-changed
name: Test ${{matrix.name}} on ${{matrix.runner_provider}} V4 # Up the version with every change to keep track of flaky tests
uses: ./.github/workflows/ui-tests-common.yml
strategy:
fail-fast: false
matrix:
runner_provider: ["cirrus", "bitrise"]
job_id:
- ios_objc
- tvos_swift
include:
- job_id: ios_objc
name: iOS Objective-C
target: ios_objc
platform: iOS
- job_id: tvos_swift
name: tvOS Swift
target: tvos_swift
platform: tvOS
with:
fastlane_command: ui_tests_${{matrix.target}}
xcode_version: "16"
build_with_make: true
macos_version: "sequoia"
codecov_test_analytics: true
files_suffix: _${{matrix.target}}_
platform: ${{matrix.platform}}
runner_provider: ${{matrix.runner_provider}}
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
ui-tests-swift-ui:
if: github.event_name != 'pull_request' || needs.files-changed.outputs.run_ui_tests_for_prs == 'true'
needs: files-changed
name: Test SwiftUI on ${{matrix.runner_provider}} V5 # Up the version with every change to keep track of flaky tests
uses: ./.github/workflows/ui-tests-common.yml
with:
fastlane_command: ui_tests_ios_swiftui
build_with_make: true
codecov_test_analytics: true
xcode_version: "16"
macos_version: "sequoia"
files_suffix: _swiftui_
platform: "iOS"
runner_provider: ${{matrix.runner_provider}}
strategy:
matrix:
runner_provider: ["cirrus", "bitrise"]
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
ui-tests-swift:
if: github.event_name != 'pull_request' || needs.files-changed.outputs.run_ui_tests_for_prs == 'true'
needs: files-changed
name: Test Swift ${{matrix.name}} on ${{matrix.runner_provider}} V6 # Up the version with every change to keep track of flaky tests
uses: ./.github/workflows/ui-tests-common.yml
strategy:
fail-fast: false
matrix:
runner_provider: ["cirrus", "bitrise"]
job_id:
- ios_17
- ios_18
- ios_26
include:
- job_id: ios_17
name: iOS 17
runs_on: sequoia
xcode: "16"
test_destination_os: "17.5"
platform: "iOS"
device: iPhone 15 Pro
- job_id: ios_18
name: iOS 18
runs_on: sequoia
xcode: "16"
platform: "iOS"
- job_id: ios_26
name: iOS 26
runs_on: tahoe
xcode: "26"
platform: "iOS"
with:
fastlane_command: ui_tests_ios_swift
files_suffix: _xcode_${{matrix.xcode}}-${{matrix.device}}
build_with_make: true
macos_version: ${{matrix.runs_on}}
codecov_test_analytics: true
xcode_version: ${{ matrix.xcode}}
test-destination-os: ${{matrix.test_destination_os}}
platform: ${{matrix.platform}}
device: ${{matrix.device}}
runner_provider: ${{matrix.runner_provider}}
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
ui-tests-swift6:
if: github.event_name != 'pull_request' || needs.files-changed.outputs.run_ui_tests_for_prs == 'true'
needs: files-changed
name: Test iOS Swift6 on ${{matrix.runner_provider}} V4 # Up the version with every change to keep track of flaky tests
uses: ./.github/workflows/ui-tests-common.yml
with:
fastlane_command: ui_tests_ios_swift6
xcode_version: "16"
build_with_make: true
macos_version: "sequoia"
codecov_test_analytics: true
platform: iOS
files_suffix: _swift6_
runner_provider: ${{matrix.runner_provider}}
strategy:
matrix:
runner_provider: ["cirrus", "bitrise"]
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
# This check validates that either UI tests passed or were skipped, which allows us
# to make UI tests a required check with only running the UI tests when required.
# So, we don't have to run UI tests, for example, for unrelated changes.
ui_tests-required-check:
needs:
[
files-changed,
ui-tests,
ui-tests-swift-ui,
ui-tests-swift,
ui-tests-swift6,
ready-to-merge-gate,
]
name: UI Tests - Check
# This is necessary since a failed/skipped dependent job would cause this job to be skipped
if: always()
runs-on: ubuntu-latest
steps:
# If any jobs we depend on fails gets cancelled or times out, this job will fail.
# Skipped jobs are not considered failures.
- name: Check for failures
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: |
echo "One of the UI test jobs has failed." && exit 1