|
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: "${{ inputs.macos_xcode_versions }}" |
| 26 | + ios_host_exclude_xcode_versions: |
| 27 | + type: string |
| 28 | + description: "Exclude Xcode version list (JSON)" |
| 29 | + default: "${{ inputs.macos_exclude_xcode_versions }}" |
| 30 | + ios_host_versions: |
| 31 | + type: string |
| 32 | + description: "iOS host (macOS) version list (JSON)" |
| 33 | + default: "${{ inputs.macos_versions }}" |
| 34 | + ios_host_archs: |
| 35 | + type: string |
| 36 | + description: "iOS host (macOS) arch list (JSON)" |
| 37 | + default: "${{ inputs.macos_archs }}" |
22 | 38 | linux_swift_versions: |
23 | 39 | type: string |
24 | 40 | description: "Include Linux Swift version list (JSON)" |
|
80 | 96 | type: string |
81 | 97 | description: "macOS command to build and test the package" |
82 | 98 | default: "xcrun swift test" |
| 99 | + ios_pre_build_command: |
| 100 | + type: string |
| 101 | + description: "macOS command to execute before building the Swift package for iOS" |
| 102 | + default: "" |
| 103 | + ios_build_command: |
| 104 | + type: string |
| 105 | + description: "macOS command to build the package for iOS" |
| 106 | + default: "xcrun swift build --build-tests --sdk "$(xcrun --sdk iphoneos --show-sdk-path)" --triple arm64-apple-ios" |
83 | 107 | linux_build_command: |
84 | 108 | type: string |
85 | 109 | description: "Linux command to build and test the package" |
|
106 | 130 | macos_env_vars: |
107 | 131 | description: "Newline separated list of environment variables" |
108 | 132 | type: string |
| 133 | + ios_host_env_vars: |
| 134 | + description: "Newline separated list of environment variables" |
| 135 | + type: string |
109 | 136 | linux_env_vars: |
110 | 137 | description: "Newline separated list of environment variables" |
111 | 138 | type: string |
|
132 | 159 | type: boolean |
133 | 160 | description: "Boolean to enable macOS testing. Defaults to false" |
134 | 161 | default: false |
| 162 | + enable_ios_checks: |
| 163 | + type: boolean |
| 164 | + description: "Boolean to enable iOS testing. Defaults to false" |
| 165 | + default: false |
135 | 166 | enable_windows_checks: |
136 | 167 | type: boolean |
137 | 168 | description: "Boolean to enable windows testing. Defaults to true" |
@@ -186,6 +217,42 @@ jobs: |
186 | 217 | run: ${{ inputs.macos_build_command }} ${{ (contains(matrix.swift_version, 'nightly') && inputs.swift_nightly_flags) || inputs.swift_flags }} |
187 | 218 | timeout-minutes: 60 |
188 | 219 |
|
| 220 | + ios-build: |
| 221 | + name: iOS (Build Only, Xcode ${{ matrix.xcode_version }} - ${{ matrix.os_version }} - ${{ matrix.arch }}) |
| 222 | + if: ${{ inputs.enable_ios_checks }} |
| 223 | + runs-on: [self-hosted, macos, "${{ matrix.os_version }}", "${{ matrix.arch }}"] |
| 224 | + strategy: |
| 225 | + fail-fast: false |
| 226 | + matrix: |
| 227 | + xcode_version: ${{ fromJson(inputs.ios_host_xcode_versions) }} |
| 228 | + os_version: ${{ fromJson(inputs.ios_host_versions) }} |
| 229 | + arch: ${{ fromJson(inputs.ios_host_archs) }} |
| 230 | + exclude: |
| 231 | + - ${{ fromJson(inputs.ios_host_exclude_xcode_versions) }} |
| 232 | + steps: |
| 233 | + - name: Checkout repository |
| 234 | + uses: actions/checkout@v4 |
| 235 | + - name: Provide token |
| 236 | + if: ${{ inputs.needs_token }} |
| 237 | + run: | |
| 238 | + echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV |
| 239 | + - name: Set environment variables |
| 240 | + if: ${{ inputs.ios_host_env_vars }} |
| 241 | + run: | |
| 242 | + for i in "${{ inputs.ios_host_env_vars }}" |
| 243 | + do |
| 244 | + printf "%s\n" $i >> $GITHUB_ENV |
| 245 | + done |
| 246 | + - name: Select Xcode |
| 247 | + run: echo "DEVELOPER_DIR=/Applications/Xcode_${{ matrix.xcode_version }}.app" >> $GITHUB_ENV |
| 248 | + - name: Swift version |
| 249 | + run: xcrun swift --version |
| 250 | + - name: Pre-build |
| 251 | + run: ${{ inputs.ios_pre_build_command }} |
| 252 | + - name: Build |
| 253 | + run: ${{ inputs.ios_build_command }} ${{ (contains(matrix.swift_version, 'nightly') && inputs.swift_nightly_flags) || inputs.swift_flags }} |
| 254 | + timeout-minutes: 60 |
| 255 | + |
189 | 256 | linux-build: |
190 | 257 | name: Linux (${{ matrix.swift_version }} - ${{ matrix.os_version }}) |
191 | 258 | if: ${{ inputs.enable_linux_checks }} |
|
0 commit comments