From 9602fe95ed879a40e2da4a819c37680564cfbed7 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Wed, 9 Oct 2024 10:38:38 -0700 Subject: [PATCH] Move Xcode 16 jobs to the macos-15 runner Xcode 16 will be removed from macos-14 to cut down on the image size: https://github.com/actions/runner-images/issues/10703 --- .github/workflows/build-pr.yml | 62 +++++++++++++++---------------- .github/workflows/master-push.yml | 55 +++++++++++++++++---------- scripts/pr-ci-matrix.rb | 5 ++- 3 files changed, 69 insertions(+), 53 deletions(-) diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml index 0d37793fd3..b8d048d805 100644 --- a/.github/workflows/build-pr.yml +++ b/.github/workflows/build-pr.yml @@ -46,7 +46,7 @@ jobs: - run: sh -x build.sh verify-osx osx-16: - runs-on: macos-14 + runs-on: macos-15 name: Test osx on Xcode 16 env: DEVELOPER_DIR: '/Applications/Xcode_16.app/Contents/Developer' @@ -55,7 +55,7 @@ jobs: - run: sh -x build.sh verify-osx osx-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test osx on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' @@ -64,7 +64,7 @@ jobs: - run: sh -x build.sh verify-osx osx-encryption-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test osx-encryption on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' @@ -82,7 +82,7 @@ jobs: - run: sh -x build.sh verify-swiftpm swiftpm-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test swiftpm on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' @@ -109,7 +109,7 @@ jobs: - run: sh -x build.sh verify-swiftpm-debug swiftpm-debug-16: - runs-on: macos-14 + runs-on: macos-15 name: Test swiftpm-debug on Xcode 16 env: DEVELOPER_DIR: '/Applications/Xcode_16.app/Contents/Developer' @@ -118,7 +118,7 @@ jobs: - run: sh -x build.sh verify-swiftpm-debug swiftpm-debug-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test swiftpm-debug on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' @@ -127,7 +127,7 @@ jobs: - run: sh -x build.sh verify-swiftpm-debug swiftpm-address-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test swiftpm-address on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' @@ -136,7 +136,7 @@ jobs: - run: sh -x build.sh verify-swiftpm-address swiftpm-thread-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test swiftpm-thread on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' @@ -154,7 +154,7 @@ jobs: - run: sh -x build.sh verify-ios-static ios-static-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test ios-static on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' @@ -172,7 +172,7 @@ jobs: - run: sh -x build.sh verify-ios ios-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test ios on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' @@ -190,7 +190,7 @@ jobs: - run: sh -x build.sh verify-watchos watchos-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test watchos on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' @@ -208,7 +208,7 @@ jobs: - run: sh -x build.sh verify-tvos tvos-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test tvos on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' @@ -226,7 +226,7 @@ jobs: - run: sh -x build.sh verify-visionos visionos-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test visionos on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' @@ -253,7 +253,7 @@ jobs: - run: sh -x build.sh verify-osx-swift osx-swift-16: - runs-on: macos-14 + runs-on: macos-15 name: Test osx-swift on Xcode 16 env: DEVELOPER_DIR: '/Applications/Xcode_16.app/Contents/Developer' @@ -262,7 +262,7 @@ jobs: - run: sh -x build.sh verify-osx-swift osx-swift-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test osx-swift on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' @@ -280,7 +280,7 @@ jobs: - run: sh -x build.sh verify-ios-swift ios-swift-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test ios-swift on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' @@ -298,7 +298,7 @@ jobs: - run: sh -x build.sh verify-tvos-swift tvos-swift-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test tvos-swift on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' @@ -307,7 +307,7 @@ jobs: - run: sh -x build.sh verify-tvos-swift osx-swift-evolution-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test osx-swift-evolution on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' @@ -316,7 +316,7 @@ jobs: - run: sh -x build.sh verify-osx-swift-evolution ios-swift-evolution-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test ios-swift-evolution on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' @@ -325,7 +325,7 @@ jobs: - run: sh -x build.sh verify-ios-swift-evolution tvos-swift-evolution-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test tvos-swift-evolution on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' @@ -343,7 +343,7 @@ jobs: - run: sh -x build.sh verify-catalyst catalyst-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test catalyst on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' @@ -361,7 +361,7 @@ jobs: - run: sh -x build.sh verify-catalyst-swift catalyst-swift-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test catalyst-swift on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' @@ -370,7 +370,7 @@ jobs: - run: sh -x build.sh verify-catalyst-swift xcframework-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test xcframework on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' @@ -397,7 +397,7 @@ jobs: - run: sh -x build.sh verify-cocoapods-osx cocoapods-osx-16: - runs-on: macos-14 + runs-on: macos-15 name: Test cocoapods-osx on Xcode 16 env: DEVELOPER_DIR: '/Applications/Xcode_16.app/Contents/Developer' @@ -406,7 +406,7 @@ jobs: - run: sh -x build.sh verify-cocoapods-osx cocoapods-osx-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test cocoapods-osx on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' @@ -415,7 +415,7 @@ jobs: - run: sh -x build.sh verify-cocoapods-osx cocoapods-ios-static-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test cocoapods-ios-static on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' @@ -424,7 +424,7 @@ jobs: - run: sh -x build.sh verify-cocoapods-ios-static cocoapods-ios-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test cocoapods-ios on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' @@ -433,7 +433,7 @@ jobs: - run: sh -x build.sh verify-cocoapods-ios cocoapods-watchos-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test cocoapods-watchos on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' @@ -442,7 +442,7 @@ jobs: - run: sh -x build.sh verify-cocoapods-watchos cocoapods-tvos-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test cocoapods-tvos on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' @@ -451,7 +451,7 @@ jobs: - run: sh -x build.sh verify-cocoapods-tvos cocoapods-catalyst-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test cocoapods-catalyst on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' @@ -460,7 +460,7 @@ jobs: - run: sh -x build.sh verify-cocoapods-catalyst ios-swiftui-16_1_beta_2: - runs-on: macos-14 + runs-on: macos-15 name: Test ios-swiftui on Xcode 16.1_beta_2 env: DEVELOPER_DIR: '/Applications/Xcode_16.1_beta_2.app/Contents/Developer' diff --git a/.github/workflows/master-push.yml b/.github/workflows/master-push.yml index 1f4a666c78..e52869aa2a 100644 --- a/.github/workflows/master-push.yml +++ b/.github/workflows/master-push.yml @@ -61,15 +61,22 @@ jobs: name: realm-examples path: realm-examples.zip build-product: # Creates framework for each platform, xcode version, target and configuration - runs-on: macos-14 name: Package framework needs: prepare strategy: - max-parallel: 20 # Blocks of 20, therefore if any of the build fails, we don't get a lot of XCode Clouds builds hanging, which are expensive. + max-parallel: 20 matrix: platform: ${{ fromJSON(needs.prepare.outputs.PLATFORM_MATRIX) }} - xcode-version: ${{ fromJSON(needs.prepare.outputs.XCODE_VERSIONS_MATRIX) }} configuration: [swift, static] + include: + - xcode-version: 15.3 + os: macos-14 + - xcode-version: 15.4 + os: macos-14 + - xcode-version: 16 + os: macos-15 + - xcode-version: 16.1_beta_2 + os: macos-15 exclude: - platform: osx configuration: static @@ -81,8 +88,7 @@ jobs: configuration: static - platform: catalyst configuration: static - - platform: visionos - xcode-version: 15.1 + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - name: Build ${{ matrix.platform }} with Xcode ${{ matrix.xcode-version }} @@ -95,16 +101,21 @@ jobs: path: build compression-level: 1 package-xcframework-platform: # Creates xcframework for each platform and xcode version - runs-on: macos-14 name: Package xcframework for platform needs: [build-product, prepare] strategy: matrix: platform: ${{ fromJSON(needs.prepare.outputs.PLATFORM_MATRIX) }} - xcode-version: ${{ fromJSON(needs.prepare.outputs.XCODE_VERSIONS_MATRIX) }} - exclude: - - platform: visionos - xcode-version: 15.1 + include: + - xcode-version: 15.3 + os: macos-14 + - xcode-version: 15.4 + os: macos-14 + - xcode-version: 16 + os: macos-15 + - xcode-version: 16.1_beta_2 + os: macos-15 + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - name: Select Xcode Version @@ -114,8 +125,7 @@ jobs: DEVELOPMENT_CERTIFICATE_BASE64: ${{ secrets.DEVELOPMENT_CERTIFICATE_BASE64 }} P12_PASSWORD: ${{ secrets.P12_PASSWORD }} KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} - run: | - sh -x build.sh install-apple-certificates + run: sh -x build.sh install-apple-certificates - name: Restore frameworks uses: actions/download-artifact@v4 with: @@ -123,8 +133,7 @@ jobs: - name: Create xcframework env: SIGNING_IDENTITY: ${{ secrets.SIGNING_IDENTITY }} - run: | - sh -x build.sh release-create-xcframework-${{ matrix.xcode-version }} ${{ matrix.platform }} + run: sh -x build.sh release-create-xcframework-${{ matrix.xcode-version }} ${{ matrix.platform }} - name: Upload xcframework uses: actions/upload-artifact@v4 with: @@ -143,8 +152,7 @@ jobs: DEVELOPMENT_CERTIFICATE_BASE64: ${{ secrets.DEVELOPMENT_CERTIFICATE_BASE64 }} P12_PASSWORD: ${{ secrets.P12_PASSWORD }} KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} - run: | - sh -x build.sh install-apple-certificates + run: sh -x build.sh install-apple-certificates - name: Restore packages xcframeworks uses: actions/download-artifact@v4 with: @@ -152,8 +160,7 @@ jobs: - name: Create release env: SIGNING_IDENTITY: ${{ secrets.SIGNING_IDENTITY }} - run: | - sh -x build.sh release-package + run: sh -x build.sh release-package - name: Upload release artifactss uses: actions/upload-artifact@v4 with: @@ -244,14 +251,22 @@ jobs: cd examples/installation bundle exec ./build.rb ${{ matrix.platform }} ${{ matrix.installation }} ${{ matrix.linkage }} test-installation-xcframework: - runs-on: macos-14 name: Run installation test for xcframework needs: [package-release, prepare] env: PLATFORM: 'osx' strategy: matrix: - xcode-version: ${{ fromJSON(needs.prepare.outputs.XCODE_VERSIONS_MATRIX) }} + include: + - xcode-version: 15.3 + os: macos-14 + - xcode-version: 15.4 + os: macos-14 + - xcode-version: 16 + os: macos-15 + - xcode-version: 16.1_beta_2 + os: macos-15 + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 diff --git a/scripts/pr-ci-matrix.rb b/scripts/pr-ci-matrix.rb index 491c4360dc..c3c42c5bbb 100755 --- a/scripts/pr-ci-matrix.rb +++ b/scripts/pr-ci-matrix.rb @@ -82,9 +82,10 @@ def minimum_version(major) if not filter.call(version) next end - output_file << """ + image = version.start_with?('16') ? 'macos-15' : 'macos-14' + output_file << """ #{name}-#{version.gsub(' ', '_').gsub('.', '_')}: - runs-on: macos-14 + runs-on: #{image} name: Test #{name} on Xcode #{version} env: DEVELOPER_DIR: '/Applications/Xcode_#{version}.app/Contents/Developer'