Skip to content

Commit

Permalink
ci: Use macOS 13 and Xcode 14.3 wherever possible (#3075)
Browse files Browse the repository at this point in the history
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 <dhiogo.brustolin@sentry.io>
Co-authored-by: Andrew McKnight <andrew.mcknight@sentry.io>
  • Loading branch information
3 people authored Jun 1, 2023
1 parent c78683b commit 69d8759
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 42 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/benchmarking.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
32 changes: 11 additions & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -40,7 +40,7 @@ jobs:

build-sample:
name: Sample ${{ matrix.scheme }}
runs-on: macos-12
runs-on: macos-13
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -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.
Expand All @@ -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

Expand All @@ -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

Expand All @@ -133,7 +123,7 @@ jobs:
# See https://git.luolix.topmunity/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
Expand All @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
jobs:
analyze:
name: Analyze
runs-on: macos-11
runs-on: macos-13

strategy:
fail-fast: false
Expand All @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/format-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,23 @@ on:
jobs:
swift-lint:
name: Swift Lint
runs-on: macos-12
runs-on: macos-13
steps:
- uses: actions/checkout@v3
- name: Run SwiftLint
run: swiftlint

xcode-analyze:
name: Xcode Analyze
runs-on: macos-12
runs-on: macos-13
steps:
- uses: actions/checkout@v3
- run: ./scripts/ci-select-xcode.sh
- run: make analyze

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']
Expand All @@ -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}"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/profile-data-generator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/testflight.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions scripts/ci-select-xcode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 69d8759

Please sign in to comment.