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