Skip to content

Commit e38c3ee

Browse files
committed
Add ability to include swift versions
In some cases, such as swiftly, there's only one particular version of swift that is being targeted at a time. It's problematic trying to exclude all of the others in the default list, and have to adjust when the workflow gets changed, making sure to exclude any additions. Add the ability for a repo like swiftly to set the list to explicit version(s) instead of excluding everything except that one version.
1 parent 3fca720 commit e38c3ee

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

.github/workflows/swift_package_test.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ name: Swift Linux Matrix
33
on:
44
workflow_call:
55
inputs:
6+
linux_swift_versions:
7+
type: string
8+
description: "Include Linux Swift version list (JSON)"
9+
default: "[\"5.8\", \"5.9\", \"5.10\", \"6.0\", \"nightly-main\", \"nightly-6.0\"]"
610
linux_exclude_swift_versions:
711
type: string
812
description: "Exclude Linux Swift version list (JSON)"
@@ -11,6 +15,10 @@ on:
1115
type: string
1216
description: "Linux OS version list (JSON)"
1317
default: "[\"jammy\"]"
18+
windows_swift_versions:
19+
type: string
20+
description: "Include Windows Swift version list (JSON)"
21+
default: "[\"5.9\", \"6.0\", \"nightly\", \"nightly-6.0\"]"
1422
windows_exclude_swift_versions:
1523
type: string
1624
description: "Exclude Windows Swift version list (JSON)"
@@ -57,7 +65,7 @@ jobs:
5765
strategy:
5866
fail-fast: false
5967
matrix:
60-
swift_version: ['5.8', '5.9', '5.10', '6.0', 'nightly-main', 'nightly-6.0']
68+
swift_version: ${{ fromJson(inputs.linux_swift_versions) }}
6169
os_version: ${{ fromJson(inputs.linux_os_versions) }}
6270
exclude:
6371
- ${{ fromJson(inputs.linux_exclude_swift_versions) }}
@@ -87,7 +95,7 @@ jobs:
8795
strategy:
8896
fail-fast: false
8997
matrix:
90-
swift_version: ['5.9', '6.0', 'nightly', 'nightly-6.0']
98+
swift_version: ${{ fromJson(inputs.windows_swift_versions) }}
9199
exclude:
92100
- ${{ fromJson(inputs.windows_exclude_swift_versions) }}
93101
steps:

0 commit comments

Comments
 (0)