Repository navigation
313 lines (292 loc) · 10.8 KB
/
Copy pathpull_request.yml
File metadata and controls
313 lines (292 loc) · 10.8 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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
name: Pull request
permissions:
contents: read
on:
pull_request:
types: [opened, reopened, synchronize]
jobs:
shell_tests:
name: Shell Tests
uses: ./.github/workflows/shell_tests.yml
tests_with_docker_embedded_swift:
name: Test Embedded Swift SDKs
uses: ./.github/workflows/swift_package_test.yml
with:
# Wasm
enable_linux_checks: false
enable_macos_checks: false
enable_windows_checks: false
wasm_sdk_pre_build_command: |
cd tests/TestPackage
enable_embedded_wasm_sdk_build: true
tests_with_docker:
name: Test with Docker
uses: ./.github/workflows/swift_package_test.yml
with:
# Linux
linux_os_versions: '["jammy", "rhel-ubi9", "amazonlinux2023"]'
# Amazon Linux 2023 images are only available for Swift 6.3 and later.
linux_exclude_swift_versions: '[{"swift_version": "5.9", "os_version": "amazonlinux2023"}, {"swift_version": "5.10", "os_version": "amazonlinux2023"}, {"swift_version": "6.0", "os_version": "amazonlinux2023"}, {"swift_version": "6.1", "os_version": "amazonlinux2023"}, {"swift_version": "6.2", "os_version": "amazonlinux2023"}]'
linux_host_archs: '["x86_64", "aarch64"]'
linux_build_command: |
cd tests/TestPackage
swift build
linux_static_sdk_pre_build_command: |
cd tests/TestPackage
enable_linux_static_sdk_build: true
# Wasm
wasm_sdk_pre_build_command: |
cd tests/TestPackage
enable_wasm_sdk_build: true
# Windows
windows_build_command: |
cd tests/TestPackage
Invoke-Program swift build
enable_windows_docker: true
tests_without_docker:
name: Test without Docker
uses: ./.github/workflows/swift_package_test.yml
with:
# Skip Linux which doesn't currently support docker-less workflow
enable_linux_checks: false
# Android
android_sdk_pre_build_command: |
cd tests/TestPackage
enable_android_sdk_build: true
enable_android_sdk_checks: true
android_ndk_versions: "[\"r30\"]"
# Windows
windows_build_command: |
cd tests/TestPackage
Invoke-Program swift build
enable_windows_docker: false
windows_os_versions: '["windows-2022", "windows-11-arm"]'
# FreeBSD
enable_freebsd_checks: true
freebsd_pre_build_command: |
cd tests/TestPackage
tests_macos:
name: Test
uses: ./.github/workflows/swift_package_test.yml
with:
enable_linux_checks: false
enable_windows_checks: false
# macOS
enable_macos_checks: true
macos_build_command: |
cd tests/TestPackage
xcrun swift build
enable_macos_swiftly_checks: true
macos_swiftly_build_command: |
cd tests/TestPackage
swiftly run swift build
build_tests_ios:
name: Build iOS Tests
uses: ./.github/workflows/swift_package_test.yml
with:
enable_linux_checks: false
enable_windows_checks: false
# iOS
enable_ios_checks: true
ios_build_command: |
cd tests/TestPackage
xcodebuild -quiet -scheme TestPackage -destination "generic/platform=ios" build
soundness:
name: Soundness
uses: ./.github/workflows/soundness.yml
with:
api_breakage_check_enabled: false
license_header_check_project_name: "Swift.org"
matrix_generator_tests:
name: Matrix generator tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
persist-credentials: false
- name: Run generator tests
working-directory: tests/MatrixGeneratorValidator
run: swift test
runner_exit_code_tests:
name: Runner exit-code tests
strategy:
fail-fast: false
matrix:
include:
- runner: [ubuntu-latest]
test: ./tests/runner-exit-code-tests.sh
shell: bash
- runner: [self-hosted, macos, tahoe, ARM64]
test: ./tests/runner-exit-code-tests-macos.sh
shell: bash
- runner: [windows-latest]
test: ./tests/invoke-program-tests.ps1
shell: pwsh
runs-on: ${{ matrix.runner }}
# A step's own `shell:` cannot read the matrix, so the job sets it for its steps.
defaults:
run:
shell: ${{ matrix.shell }}
steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
persist-credentials: false
- name: Assert failures are not reported as success
run: ${{ matrix.test }}
unified_package_test:
name: Unified package test
uses: ./.github/workflows/package_test.yml
with:
# Every platform enters the package below the repository root, the FreeBSD VM included.
package_path: tests/TestPackage
linux_swift_versions: '["6.3", "nightly-main"]'
windows_swift_versions: '["6.3"]'
windows_command: Invoke-Program swift build
# FreeBSD, the static SDK build and the Cxx interop check are on by default.
linux_static_sdk_versions: '["6.3"]'
# The rest are off: this call is about Linux, Windows, FreeBSD and the checks above.
enable_macos: false
enable_macos_swiftly: false
enable_wasm_sdk_build: false
enable_embedded_wasm_sdk_build: false
enable_android_sdk_build: false
# Two labeled commands, so a run exercises the label suffix.
linux_command: |
Debug-Build: swift build
Release-Build:
command: swift build -c release
versions: ["6.3"]
unified_package_test_container:
name: Unified package test (container)
uses: ./.github/workflows/package_test.yml
with:
# Named so this does not share a concurrency group with the native call.
name: unified-package-test-container
# A container runs as root, has no sudo, and carries neither jq nor the tools
# a hosted runner provides, none of which the native default exercises.
linux_use_docker: true
package_path: tests/TestPackage
linux_swift_versions: '["6.3"]'
# Runs the privilege-agnostic form the migration guide documents, so the
# advice is checked rather than only written down.
linux_setup_command: |
if command -v sudo >/dev/null 2>&1; then
sudo apt-get update -y -q && sudo apt-get install -y -q jq
else
apt-get update -y -q && apt-get install -y -q jq
fi
linux_command: swift build
# Windows containers too: this is the only coverage of that path, and an
# adopter testing a Swift release before 6.1 depends on it.
windows_swift_versions: '["6.3"]'
windows_use_docker: true
# A container runs its commands under cmd, where Invoke-Program does not exist.
windows_command: swift build
# Only the Linux and Windows container paths are under test here.
enable_freebsd: false
enable_macos: false
enable_macos_swiftly: false
enable_linux_static_sdk_build: false
enable_wasm_sdk_build: false
enable_embedded_wasm_sdk_build: false
enable_android_sdk_build: false
enable_cxx_interop: false
unified_package_test_commands:
name: Unified package test (commands)
uses: ./.github/workflows/package_test.yml
with:
# Named so this does not share a concurrency group with the other calls.
name: unified-package-test-commands
enable_windows: false
enable_freebsd: false
enable_macos: false
enable_macos_swiftly: false
enable_linux_static_sdk_build: false
enable_wasm_sdk_build: false
enable_embedded_wasm_sdk_build: false
enable_android_sdk_build: false
enable_cxx_interop: false
package_path: tests/TestPackage
linux_swift_versions: '["6.2", "6.3"]'
# Two commands on one toolchain list, the second narrowed to one version, so
# a run proves the axis fans out and that the label's versions select from
# the list rather than being ignored. Three jobs, each carrying its label.
linux_command: |
Debug-Build: swift build
Release-Build:
command: swift build -c release
versions: ["6.3"]
unified_toolchain_matrix:
name: Unified toolchain matrix
uses: ./.github/workflows/toolchain_matrix.yml
with:
linux_swift_versions: '["6.3"]'
unified_toolchain_matrix_execute:
name: Unified toolchain matrix executor
needs: unified_toolchain_matrix
uses: ./.github/workflows/execute_matrix.yml
with:
name: toolchain-matrix-self-test
matrix_yaml_string: ${{ needs.unified_toolchain_matrix.outputs.matrix_yaml }}
setup_command: cd tests/TestPackage
command: swift build
unified_execute_matrix:
name: Unified matrix executor
uses: ./.github/workflows/execute_matrix.yml
with:
name: execute-matrix-self-test
matrix_yaml_string: |
config:
- platform: Linux
name: Hand-written matrix entry
runner:
- ubuntu-24.04
swift_build:
swift_version: "6.3"
command: |
cd tests/TestPackage
swift build
command_arguments: []
env: {}
proposal_validation:
name: Proposal Validation
uses: ./.github/workflows/proposal_validation.yml
with:
project: "swift"
workflow_test_enabled: true
install_cmake:
name: Install CMake
uses: ./.github/workflows/install_cmake_test.yml
cmake_build:
name: CMake Build
uses: ./.github/workflows/cmake_build.yml
with:
# Linux uses the default Ninja generator; install Ninja first.
linux_pre_build_command: "apt-get install -y ninja-build"
linux_configure_command: "$CMAKE -G Ninja -B build -S tests/CMakeProject"
# Windows uses CMake's default generator (MSVC), so Ninja is not required.
windows_configure_command: "Invoke-Program cmake -B build -S tests/CMakeProject"
soundness-docs:
name: "Soundness - Docs (override_target_name: ${{ matrix.override_target_name }} ; post command: ${{ matrix.post_command }})"
strategy:
fail-fast: false
matrix:
override_target_name: ["theDocs", ""]
post_command: ["cat .spi.yml", 'rm -rfv .spi.yml']
uses: ./.github/workflows/soundness.yml
with:
concurrency_group_suffix: "${{ matrix.override_target_name }}-${{ matrix.post_command }}"
linux_pre_build_command: "cd tests/TestPackage && ${{ matrix.post_command }}"
docs_check_enabled: true
docs_check_targets: ${{ matrix.override_target_name}}
docs_check_macos_enabled: false
api_breakage_check_enabled: false
unacceptable_language_check_enabled: false
license_header_check_enabled: false
broken_symlink_check_enabled: false
format_check_enabled: false
shell_check_enabled: false
yamllint_check_enabled: false
python_lint_check_enabled: false