Skip to content

New runloop observer #12789

New runloop observer

New runloop observer #12789

Workflow file for this run

name: Build
on:
push:
branches:
- main
- release/**
pull_request:
paths:
- "Sources/**"
- "test-server/**"
- "Samples/**"
- ".github/workflows/build.yml"
- "fastlane/**"
- "scripts/ci-select-xcode.sh"
- Sentry.xcworkspace/**
- Sentry.xcodeproj/**
- Gemfile.lock
- "Package.swift"
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
# We had issues that the release build was broken on main.
# With this we catch potential issues already in the PR.
ios-swift-release:
name: Release Build of iOS Swift
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- run: ./scripts/ci-select-xcode.sh 16.3
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- run: make init-ci-build
- run: make xcode-ci
- name: Run Fastlane
env:
APP_STORE_CONNECT_KEY_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ID }}
APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }}
APP_STORE_CONNECT_KEY: ${{ secrets.APP_STORE_CONNECT_KEY }}
FASTLANE_KEYCHAIN_PASSWORD: ${{ secrets.FASTLANE_KEYCHAIN_PASSWORD }}
MATCH_GIT_PRIVATE_KEY: ${{ secrets.MATCH_GIT_PRIVATE_KEY }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
MATCH_USERNAME: ${{ secrets.MATCH_USERNAME }}
run: bundle exec fastlane build_ios_swift
build-sample:
name: Sample ${{ matrix.scheme }} ${{ matrix.config }}
runs-on: macos-15
strategy:
fail-fast: false
matrix:
# other sample projects are built in ui-tests
include:
- scheme: macOS-Swift
config: Debug
- scheme: iOS13-Swift
config: Debug
- scheme: watchOS-Swift WatchKit App
config: Debug
- scheme: macOS-SwiftUI
config: Debug
- scheme: SessionReplay-CameraTest
config: Debug
- scheme: visionOS-Swift
config: Debug
- scheme: iOS-Swift
config: DebugV9
- scheme: macOS-Swift
config: DebugV9
- scheme: tvOS-Swift
config: DebugV9
- scheme: visionOS-Swift
config: DebugV9
- scheme: iOS-SwiftUI
config: DebugV9
- scheme: iOS-ObjectiveC
config: DebugV9
steps:
- uses: actions/checkout@v4
- run: ./scripts/ci-select-xcode.sh 16.3
- run: make init-ci-build
- run: make xcode-ci
# Note: Due to complexity in implementing the CODE_SIGNING_ALLOWED flag in the sentry-xcodebuild.sh script,
# we did not yet migrate this step to use the script yet.
- run: >-
env NSUnbufferedIO=YES
xcodebuild
-workspace Sentry.xcworkspace
-scheme '${{matrix.scheme}}'
-configuration ${{matrix.config}}
CODE_SIGNING_ALLOWED="NO"
build
- name: Archiving Raw Build Logs
uses: actions/upload-artifact@v4
if: ${{ failure() || cancelled() }}
with:
name: raw-build-output-scheme-${{matrix.scheme}}
path: |
raw-build-output.log
build-spm:
name: Build with SPM
runs-on: macos-15
# Don't run this on release branches, cause the SPM Package.swift points to the unreleased versions.
if: startsWith(github.ref, 'refs/heads/release/') == false
steps:
- uses: actions/checkout@v4
# Only watchOS is compiling with SPM so far, the rest of the targets need profiling support which is still a work in progress due to the ObjC++ usage
- run: rm -r Sentry.xcodeproj && rm -r Sentry.xcworkspace && EXPERIMENTAL_SPM_BUILDS=1 xcodebuild build -scheme SentrySPM -sdk watchos -destination 'generic/platform=watchOS'
shell: sh
build-v9:
name: Build SDK v9
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- run: ./scripts/sentry-xcodebuild.sh --platform iOS --os latest --device "iPhone 16" --command build --configuration DebugV9
check-debug-without-UIKit:
name: Check no UIKit linkage (DebugWithoutUIKit)
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- name: Build for Debug
run: |
./scripts/sentry-xcodebuild.sh \
--platform iOS \
--os latest \
--ref ${{ github.ref }} \
--command build \
--device "iPhone 14" \
--configuration DebugWithoutUIKit \
--derived-data uikit-check-build
- name: Ensure UIKit is not linked
run: ./scripts/check-uikit-linkage.sh DebugWithoutUIKit uikit-check-build unlinked SentryWithoutUIKit
check-release-without-UIKit:
name: Check no UIKit linkage (ReleaseWithoutUIKit)
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- name: Build for Release
run: |
./scripts/sentry-xcodebuild.sh \
--platform iOS \
--os latest \
--ref ${{ github.ref }} \
--command build \
--device "iPhone 14" \
--configuration ReleaseWithoutUIKit \
--derived-data uikit-check-build
- name: Ensure UIKit is not linked
run: ./scripts/check-uikit-linkage.sh ReleaseWithoutUIKit uikit-check-build unlinked SentryWithoutUIKit
check-debug-with-UIKit:
name: Check UIKit linkage (Debug)
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- name: Build for Debug
run: |
./scripts/sentry-xcodebuild.sh \
--platform iOS \
--os latest \
--ref ${{ github.ref }} \
--command build \
--device "iPhone 14" \
--configuration Debug \
--derived-data uikit-check-build
- name: Ensure UIKit is linked
run: ./scripts/check-uikit-linkage.sh Debug uikit-check-build linked Sentry
check-release-with-UIKit:
name: Check UIKit linkage (Release)
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- name: Build for Release
run: |
./scripts/sentry-xcodebuild.sh \
--platform iOS \
--os latest \
--ref ${{ github.ref }} \
--command build \
--device "iPhone 14" \
--configuration Release \
--derived-data uikit-check-build
- name: Ensure UIKit is linked
run: ./scripts/check-uikit-linkage.sh Release uikit-check-build linked Sentry
# The compiler only evaluates SentryAsyncSafeLogs that get printed based on the SENTRY_ASYNC_SAFE_LOG_LEVEL.
# So if the level is set to error, which is the default, and a SENTRY_ASYNC_SAFE_LOG_DEBUG has a compiler error,
# you only get the compiler error when setting the SENTRY_ASYNC_SAFE_LOG_LEVEL to SENTRY_ASYNC_SAFE_LOG_LEVEL_DEBUG or lower.
check-compiling-async-safe-logs:
name: Check compiling Async Safe Logs
runs-on: macos-15
steps:
- uses: actions/checkout@v4
# If the SentryAsyncSafeLog doesn't contain the SENTRY_ASYNC_SAFE_LOG_LEVEL_ERROR this fails.
- name: Async Safe Log Level is Error
run: grep -c "SENTRY_ASYNC_SAFE_LOG_LEVEL SENTRY_ASYNC_SAFE_LOG_LEVEL_ERROR" Sources/Sentry/SentryAsyncSafeLog.h
- name: Set Async Safe Log Level to Debug
run: |
sed -i '' 's/#define SENTRY_ASYNC_SAFE_LOG_LEVEL SENTRY_ASYNC_SAFE_LOG_LEVEL_ERROR/#define SENTRY_ASYNC_SAFE_LOG_LEVEL SENTRY_ASYNC_SAFE_LOG_LEVEL_TRACE/' Sources/Sentry/SentryAsyncSafeLog.h
shell: bash
- run: ./scripts/ci-select-xcode.sh 16.3
- name: Build for Debug
run: |
./scripts/sentry-xcodebuild.sh \
--platform iOS \
--os latest \
--ref ${{ github.ref }} \
--command build \
--device "iPhone 16" \
--configuration Debug