|
19 | 19 | type: string
|
20 | 20 | description: "macOS arch list (JSON)"
|
21 | 21 | default: "[\"ARM64\"]"
|
| 22 | + ios_host_xcode_versions: |
| 23 | + type: string |
| 24 | + description: "Xcode version list (JSON)" |
| 25 | + default: null |
| 26 | + ios_host_exclude_xcode_versions: |
| 27 | + type: string |
| 28 | + description: "Exclude Xcode version list (JSON)" |
| 29 | + default: null |
| 30 | + ios_host_versions: |
| 31 | + type: string |
| 32 | + description: "iOS host (macOS) version list (JSON)" |
| 33 | + default: null |
| 34 | + ios_host_archs: |
| 35 | + type: string |
| 36 | + description: "iOS host (macOS) arch list (JSON)" |
| 37 | + default: null |
22 | 38 | linux_swift_versions:
|
23 | 39 | type: string
|
24 | 40 | description: "Include Linux Swift version list (JSON)"
|
|
84 | 100 | type: string
|
85 | 101 | description: "macOS command to build and test the package"
|
86 | 102 | default: "xcrun swift test"
|
| 103 | + ios_pre_build_command: |
| 104 | + type: string |
| 105 | + description: "macOS command to execute before building the Swift package for iOS" |
| 106 | + default: "" |
| 107 | + ios_build_command: |
| 108 | + type: string |
| 109 | + description: "macOS command to build the package for iOS" |
| 110 | + default: "xcrun swift build --build-tests --sdk \"$(xcrun --sdk iphoneos --show-sdk-path)\" --triple arm64-apple-ios" |
87 | 111 | linux_build_command:
|
88 | 112 | type: string
|
89 | 113 | description: "Linux command to build and test the package"
|
|
110 | 134 | macos_env_vars:
|
111 | 135 | description: "Newline separated list of environment variables"
|
112 | 136 | type: string
|
| 137 | + ios_host_env_vars: |
| 138 | + description: "Newline separated list of environment variables" |
| 139 | + type: string |
113 | 140 | linux_env_vars:
|
114 | 141 | description: "Newline separated list of environment variables"
|
115 | 142 | type: string
|
|
136 | 163 | type: boolean
|
137 | 164 | description: "Boolean to enable macOS testing. Defaults to false"
|
138 | 165 | default: false
|
| 166 | + enable_ios_checks: |
| 167 | + type: boolean |
| 168 | + description: "Boolean to enable iOS testing. Defaults to false" |
| 169 | + default: false |
139 | 170 | enable_windows_checks:
|
140 | 171 | type: boolean
|
141 | 172 | description: "Boolean to enable windows testing. Defaults to true"
|
@@ -192,6 +223,42 @@ jobs:
|
192 | 223 | run: ${{ inputs.macos_build_command }} ${{ (contains(matrix.swift_version, 'nightly') && inputs.swift_nightly_flags) || inputs.swift_flags }}
|
193 | 224 | timeout-minutes: 60
|
194 | 225 |
|
| 226 | + ios-build: |
| 227 | + name: iOS (Build Only, Xcode ${{ matrix.xcode_version }} - ${{ matrix.os_version }} - ${{ matrix.arch }}) |
| 228 | + if: ${{ inputs.enable_ios_checks }} |
| 229 | + runs-on: [self-hosted, macos, "${{ matrix.os_version }}", "${{ matrix.arch }}"] |
| 230 | + strategy: |
| 231 | + fail-fast: false |
| 232 | + matrix: |
| 233 | + xcode_version: ${{ fromJson(inputs.ios_host_xcode_versions || inputs.macos_xcode_versions) }} |
| 234 | + os_version: ${{ fromJson(inputs.ios_host_versions || inputs.macos_versions) }} |
| 235 | + arch: ${{ fromJson(inputs.ios_host_archs || inputs.macos_archs) }} |
| 236 | + exclude: |
| 237 | + - ${{ fromJson(inputs.ios_host_exclude_xcode_versions || inputs.macos_exclude_xcode_versions) }} |
| 238 | + steps: |
| 239 | + - name: Checkout repository |
| 240 | + uses: actions/checkout@v4 |
| 241 | + - name: Provide token |
| 242 | + if: ${{ inputs.needs_token }} |
| 243 | + run: | |
| 244 | + echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV |
| 245 | + - name: Set environment variables |
| 246 | + if: ${{ inputs.ios_host_env_vars }} |
| 247 | + run: | |
| 248 | + for i in "${{ inputs.ios_host_env_vars }}" |
| 249 | + do |
| 250 | + printf "%s\n" $i >> $GITHUB_ENV |
| 251 | + done |
| 252 | + - name: Select Xcode |
| 253 | + run: echo "DEVELOPER_DIR=/Applications/Xcode_${{ matrix.xcode_version }}.app" >> $GITHUB_ENV |
| 254 | + - name: Swift version |
| 255 | + run: xcrun swift --version |
| 256 | + - name: Pre-build |
| 257 | + run: ${{ inputs.ios_pre_build_command }} |
| 258 | + - name: Build |
| 259 | + run: ${{ inputs.ios_build_command }} ${{ (contains(matrix.swift_version, 'nightly') && inputs.swift_nightly_flags) || inputs.swift_flags }} |
| 260 | + timeout-minutes: 60 |
| 261 | + |
195 | 262 | linux-build:
|
196 | 263 | name: Linux (${{ matrix.swift_version }} - ${{ matrix.os_version }})
|
197 | 264 | if: ${{ inputs.enable_linux_checks }}
|
|
0 commit comments