From 69d87595b411be6c93e72de62bc47457202fb72d Mon Sep 17 00:00:00 2001 From: Philipp Hofmann Date: Thu, 1 Jun 2023 09:03:26 +0200 Subject: [PATCH] ci: Use macOS 13 and Xcode 14.3 wherever possible (#3075) Use macOS 13 with Xcode 14.3 to speed up the build, as the macOS 13 GH image is faster than macOS 12. Co-authored-by: Dhiogo Ramos Brustolin Co-authored-by: Andrew McKnight --- .github/workflows/benchmarking.yml | 4 +-- .github/workflows/build.yml | 32 +++++++------------- .github/workflows/codeql-analysis.yml | 4 +-- .github/workflows/format-code.yml | 2 +- .github/workflows/lint.yml | 8 ++--- .github/workflows/profile-data-generator.yml | 4 +-- .github/workflows/test.yml | 14 ++++----- .github/workflows/testflight.yml | 2 +- scripts/ci-select-xcode.sh | 4 +-- 9 files changed, 32 insertions(+), 42 deletions(-) diff --git a/.github/workflows/benchmarking.yml b/.github/workflows/benchmarking.yml index 0b880706fcd..5dbe6090bb6 100644 --- a/.github/workflows/benchmarking.yml +++ b/.github/workflows/benchmarking.yml @@ -23,7 +23,7 @@ on: jobs: build-benchmark-test-target: name: Build app and test runner - runs-on: macos-12 + runs-on: macos-13 steps: - uses: actions/checkout@v3 - run: ./scripts/ci-select-xcode.sh @@ -96,7 +96,7 @@ jobs: app-metrics: name: Collect app metrics - runs-on: macos-12 + runs-on: macos-13 steps: - name: Git checkout uses: actions/checkout@v3 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c69a56eaa66..57dec996977 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,7 +21,7 @@ jobs: # With this we catch potential issues already in the PR. ios-swift-release: name: Release Build of iOS Swift - runs-on: macos-12 + runs-on: macos-13 steps: - uses: actions/checkout@v3 - run: ./scripts/ci-select-xcode.sh @@ -40,7 +40,7 @@ jobs: build-sample: name: Sample ${{ matrix.scheme }} - runs-on: macos-12 + runs-on: macos-13 strategy: fail-fast: false matrix: @@ -68,7 +68,7 @@ jobs: runs-on: macos-12 steps: - uses: actions/checkout@v3 - - run: ./scripts/ci-select-xcode.sh + - run: ./scripts/ci-select-xcode.sh 13.4.1 - run: make build-for-watchos # Disable code signing. We just want to make sure these compile. @@ -82,17 +82,10 @@ jobs: build-xcframework: name: Build XCFramework - runs-on: macos-12 + runs-on: macos-13 steps: - uses: actions/checkout@v3 - - # We need to use Xcode 13 to be compatible with Xcode 13. Using Xcode 14 for compiling and building - # the sample with Xcode 13 leads to - # - # this SDK is not supported by the compiler (the SDK is built with 'Apple Swift version 5.7.2 - # (swiftlang-5.7.2.135.5 clang-1400.0.29.51)', while this compiler is 'Apple Swift version 5.6.1 - # (swiftlang-5.6.0.323.66 clang-1316.0.20.12)'). Please select a toolchain which matches the SDK. - - run: ./scripts/ci-select-xcode.sh 13.4.1 + - run: ./scripts/ci-select-xcode.sh - run: make build-xcframework shell: sh @@ -113,18 +106,15 @@ jobs: build-xcframework.log validate-xcframework: - name: Validate XCFramework Xcode ${{ matrix.xcode }} - runs-on: macos-12 + name: Validate XCFramework + runs-on: macos-13 needs: build-xcframework - strategy: - matrix: - xcode: ['13.4.1', '14.2'] steps: - uses: actions/checkout@v3 - uses: actions/download-artifact@v3 with: name: ${{ github.sha }} - - run: ./scripts/ci-select-xcode.sh ${{ matrix.xcode }} + - run: ./scripts/ci-select-xcode.sh - run: make build-xcframework-sample shell: sh @@ -133,7 +123,7 @@ jobs: # See https://github.community/t/github-sha-isnt-the-value-expected/17903/17906. validate-spm: name: Validate Swift Package Manager - runs-on: macos-12 + runs-on: macos-13 steps: - uses: actions/checkout@v3 - name: Set SPM revision to current git commit @@ -150,7 +140,7 @@ jobs: validate-spm-dynamic: name: Validate Swift Package Manager Dynamic - runs-on: macos-11 + runs-on: macos-13 steps: - uses: actions/checkout@v3 - name: Set SPM revision to current git commit @@ -167,7 +157,7 @@ jobs: swift-build: name: Build with Swift - runs-on: macos-12 + runs-on: macos-13 steps: - uses: actions/checkout@v3 - run: swift build diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 28ec27eadea..c3924d25987 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -12,7 +12,7 @@ on: jobs: analyze: name: Analyze - runs-on: macos-11 + runs-on: macos-13 strategy: fail-fast: false @@ -34,7 +34,7 @@ jobs: -workspace Sentry.xcworkspace -scheme Sentry -configuration Release - -destination platform="iOS Simulator,OS=latest,name=iPhone 11 Pro" | xcpretty && exit ${PIPESTATUS[0]} + -destination platform="iOS Simulator,OS=latest,name=iPhone 14 Pro" | xcpretty && exit ${PIPESTATUS[0]} - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@0225834cc549ee0ca93cb085b92954821a145866 # pin@v2 diff --git a/.github/workflows/format-code.yml b/.github/workflows/format-code.yml index c998579e620..ab01941efe7 100644 --- a/.github/workflows/format-code.yml +++ b/.github/workflows/format-code.yml @@ -13,7 +13,7 @@ jobs: # if necessary format-code: name: Format Code - runs-on: macos-12 + runs-on: macos-13 steps: - uses: actions/checkout@v3 ## Update internal list of formulae to the latest diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 5ad233a3051..f7fad723290 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -26,7 +26,7 @@ on: jobs: swift-lint: name: Swift Lint - runs-on: macos-12 + runs-on: macos-13 steps: - uses: actions/checkout@v3 - name: Run SwiftLint @@ -34,7 +34,7 @@ jobs: xcode-analyze: name: Xcode Analyze - runs-on: macos-12 + runs-on: macos-13 steps: - uses: actions/checkout@v3 - run: ./scripts/ci-select-xcode.sh @@ -42,7 +42,7 @@ jobs: lint-podspec: name: pod lint ${{ matrix.podspec}} ${{ matrix.library_type }} ${{ matrix.platform}} - runs-on: macos-12 + runs-on: macos-13 strategy: matrix: podspec: ['Sentry', 'SentrySwiftUI'] @@ -63,7 +63,7 @@ jobs: steps: - uses: actions/checkout@v3 - - run: ./scripts/ci-select-xcode.sh '14.3' + - run: ./scripts/ci-select-xcode.sh - run: pod repo update - name: Validate HybridPod Podspec run: pod lib lint ./Tests/HybridSDKTest/HybridPod.podspec --allow-warnings --verbose --platforms=ios "--include-podspecs={SentryPrivate.podspec,Sentry.podspec}" diff --git a/.github/workflows/profile-data-generator.yml b/.github/workflows/profile-data-generator.yml index dc2e513d458..b09d4fcfc07 100644 --- a/.github/workflows/profile-data-generator.yml +++ b/.github/workflows/profile-data-generator.yml @@ -12,10 +12,10 @@ on: jobs: build-profile-data-generator-targets: name: Build app and test runner - runs-on: macos-12 + runs-on: macos-13 steps: - uses: actions/checkout@v3 - - run: ./scripts/ci-select-xcode.sh 13.4.1 + - run: ./scripts/ci-select-xcode.sh - name: Install SentryCli run: brew install getsentry/tools/sentry-cli - name: Cache Carthage dependencies diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4573b93cf3f..a5da5be84be 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,7 +30,7 @@ on: jobs: build-test-server: name: Build test server - runs-on: macos-12 + runs-on: macos-13 steps: - uses: actions/checkout@v3 - name: Cache for Test Server @@ -246,7 +246,7 @@ jobs: # that adds a significant overhead. thread-sanitizer: name: Unit iOS - Thread Sanitizer - runs-on: macos-12 + runs-on: macos-13 # When there are threading issues the tests sometimes keep hanging timeout-minutes: 20 @@ -287,7 +287,7 @@ jobs: steps: - uses: actions/checkout@v3 - - run: ./scripts/ci-select-xcode.sh "14.3" + - run: ./scripts/ci-select-xcode.sh # GitHub Actions sometimes fail to launch the UI tests. Therefore we retry - name: Run Fastlane @@ -315,8 +315,8 @@ jobs: xcode: '13.4.1' device: 'iPhone 8 (15.2)' - - runs-on: macos-12 - xcode: '14.1' + - runs-on: macos-13 + xcode: '14.3' device: 'iPhone 8 (16.1)' steps: @@ -339,11 +339,11 @@ jobs: ui-tests-address-sanitizer: name: UI Tests with Address Sanitizer - runs-on: macos-12 + runs-on: macos-13 steps: - uses: actions/checkout@v3 - - run: ./scripts/ci-select-xcode.sh 13.4.1 + - run: ./scripts/ci-select-xcode.sh # GitHub Actions sometimes fail to launch the UI tests. Therefore we retry - name: Run Fastlane diff --git a/.github/workflows/testflight.yml b/.github/workflows/testflight.yml index 1539a609082..1f1df4470e7 100644 --- a/.github/workflows/testflight.yml +++ b/.github/workflows/testflight.yml @@ -21,7 +21,7 @@ jobs: runs-on: macos-13 steps: - uses: actions/checkout@v3 - - run: ./scripts/ci-select-xcode.sh 14.3 + - run: ./scripts/ci-select-xcode.sh - run: bundle install # We upload a new version to TestFlight on every commit on main diff --git a/scripts/ci-select-xcode.sh b/scripts/ci-select-xcode.sh index 605c4641a0a..8a8e7c87ad1 100755 --- a/scripts/ci-select-xcode.sh +++ b/scripts/ci-select-xcode.sh @@ -7,8 +7,8 @@ set -euo pipefail -# 13.4.1 is the default -XCODE_VERSION="${1:-13.4.1}" +# 14.3 is the default +XCODE_VERSION="${1:-14.3}" sudo xcode-select -s /Applications/Xcode_${XCODE_VERSION}.app/Contents/Developer swiftc --version