-
Notifications
You must be signed in to change notification settings - Fork 282
206 lines (175 loc) · 7.15 KB
/
integration-tests.yml
File metadata and controls
206 lines (175 loc) · 7.15 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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
name: Integration tests
on:
schedule:
- cron: '0 2 * * 1-5'
workflow_dispatch:
permissions: {}
jobs:
integration_tests:
name: Integration Tests
runs-on: macos-26
timeout-minutes: 45
needs: build
concurrency:
# Only allow a single run of this workflow on each branch, automatically cancelling older runs.
group: integration-tests-${{ github.head_ref }}
cancel-in-progress: false
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
fetch-depth: 1
- name: Cache Swift tools build
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: .build
key: tools-${{ runner.os }}-${{ hashFiles('Package.resolved') }}
restore-keys: tools-${{ runner.os }}-
- name: Setup environment
run:
source ci_scripts/ci_common.sh && setup_github_actions_environment
- name: Download build products
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: integration-tests-build-products
path: DerivedData/Build/Products
- name: Extract build products
run: |
cd DerivedData/Build/Products
tar -xzf build-products.tar.gz
- name: Run tests
run: |
XCTESTRUN=$(ls DerivedData/Build/Products/*.xctestrun)
swift run -q tools ci integration-tests --xctestrun-path "$XCTESTRUN"
env:
INTEGRATION_TESTS_HOST: ${{ secrets.INTEGRATION_TESTS_HOST }}
INTEGRATION_TESTS_USERNAME: ${{ secrets.INTEGRATION_TESTS_USERNAME }}
INTEGRATION_TESTS_PASSWORD: ${{ secrets.INTEGRATION_TESTS_PASSWORD }}
- name: Archive artifacts
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
# We only care about artefacts if the tests fail
if: failure()
with:
name: Results
path: test_output/IntegrationTests.xcresult.zip
retention-days: 7
if-no-files-found: ignore
- name: Upload coverage to Codecov
# Skip if not successful and in forks
if: ${{ success() && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) }}
uses: codecov/codecov-action@75cd11691c0faa626561e295848008c8a7dddffe # v5.5.4
with:
report_type: coverage
files: test_output/integration-cobertura.xml
disable_search: true
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
flags: integrationtests
- name: Upload test results to Codecov
# Skip if cancelled and in forks
if: ${{ !cancelled() && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) }}
uses: codecov/codecov-action@75cd11691c0faa626561e295848008c8a7dddffe # v5.5.4
continue-on-error: true
with:
report_type: test_results
files: test_output/integration-junit.xml
disable_search: true
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
flags: integrationtests
build:
name: Build Integration Tests
runs-on: macos-26
timeout-minutes: 30
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
fetch-depth: 1
- name: Cache Swift tools build
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: .build
key: tools-${{ runner.os }}-${{ hashFiles('Package.resolved') }}
restore-keys: tools-${{ runner.os }}-
- name: Setup environment
run:
source ci_scripts/ci_common.sh && setup_github_actions_environment
- name: Build tests
run: swift run -q tools ci build --scheme IntegrationTests
- name: Archive build products
run: |
cd DerivedData/Build/Products
tar -czf build-products.tar.gz *.xctestrun Debug-iphonesimulator/
- name: Upload build products
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: integration-tests-build-products
path: DerivedData/Build/Products/build-products.tar.gz
retention-days: 1
server_login_tests:
name: Server Login Tests (${{ matrix.server }})
runs-on: macos-26
environment: integration-tests
timeout-minutes: 30
needs: build
strategy:
fail-fast: false
matrix:
include:
- server: default
host_secret: INTEGRATION_TESTS_HOST
username_secret: INTEGRATION_TESTS_USERNAME
password_secret: INTEGRATION_TESTS_PASSWORD
- server: lts
host_secret: INTEGRATION_TESTS_LTS_HOST
username_secret: INTEGRATION_TESTS_LTS_USERNAME
password_secret: INTEGRATION_TESTS_LTS_PASSWORD
- server: lts-1
host_secret: INTEGRATION_TESTS_LTS_1_HOST
username_secret: INTEGRATION_TESTS_LTS_1_USERNAME
password_secret: INTEGRATION_TESTS_LTS_1_PASSWORD
concurrency:
# Only allow a single run of this workflow on each branch, automatically cancelling older runs.
group: server-login-tests-${{ matrix.server }}-${{ github.head_ref }}
cancel-in-progress: false
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
fetch-depth: 1
- name: Cache Swift tools build
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: .build
key: tools-${{ runner.os }}-${{ hashFiles('Package.resolved') }}
restore-keys: tools-${{ runner.os }}-
- name: Setup environment
run:
source ci_scripts/ci_common.sh && setup_github_actions_environment
- name: Download build products
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: integration-tests-build-products
path: DerivedData/Build/Products
- name: Extract build products
run: |
cd DerivedData/Build/Products
tar -xzf build-products.tar.gz
- name: Run tests
run: |
XCTESTRUN=$(ls DerivedData/Build/Products/*.xctestrun)
swift run -q tools ci server-login-tests --xctestrun-path "$XCTESTRUN"
env:
INTEGRATION_TESTS_HOST: ${{ secrets[matrix.host_secret] }}
INTEGRATION_TESTS_USERNAME: ${{ secrets[matrix.username_secret] }}
INTEGRATION_TESTS_PASSWORD: ${{ secrets[matrix.password_secret] }}
- name: Archive artifacts
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
# We only care about artefacts if the tests fail
if: failure()
with:
name: Results (${{ matrix.server }})
path: test_output/IntegrationTests.xcresult.zip
retention-days: 7
if-no-files-found: ignore