Remove sentry serializable public api #14374
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | |
on: | |
push: | |
branches: | |
- main | |
- release/** | |
pull_request: | |
# Concurrency configuration: | |
# - We use workflow-specific concurrency groups to allow independent test runs across different workflows | |
# while preventing multiple runs of the same test suite on the same branch/commit. | |
# - For pull requests, we cancel in-progress runs when new commits are pushed to save CI resources | |
# and provide faster feedback on the latest changes. | |
# - For main branch pushes and scheduled runs, we never cancel in-progress runs to ensure the complete | |
# test suite always finishes, maintaining the integrity of our main branch quality gates. | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
jobs: | |
# This job detects if the PR contains changes that require running unit tests. | |
# If yes, the job will output a flag that will be used by the next job to run the unit tests. | |
# If no, the job will output a flag that will be used by the next job to skip running the unit tests. | |
# At the end of this workflow, we run a check that validates that either all unit tests passed or were | |
# called unit-tests-required-check. | |
files-changed: | |
name: Detect File Changes | |
runs-on: ubuntu-latest | |
# Map a step output to a job output | |
outputs: | |
run_unit_tests_for_prs: ${{ steps.changes.outputs.run_unit_tests_for_prs }} | |
steps: | |
- uses: actions/checkout@v5 | |
- name: Get changed files | |
id: changes | |
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 | |
with: | |
token: ${{ github.token }} | |
filters: .github/file-filters.yml | |
build-test-server: | |
name: Build test server | |
if: needs.files-changed.outputs.run_unit_tests_for_prs == 'true' | |
needs: files-changed | |
runs-on: macos-15 | |
steps: | |
- uses: actions/checkout@v5 | |
- name: Cache for Test Server | |
id: cache_test_server | |
uses: actions/cache@v4 | |
with: | |
path: ./test-server/.build | |
key: test-server-${{ hashFiles('./test-server') }}-universal | |
restore-keys: | | |
test-server-${{ hashFiles('./test-server') }}-universal | |
test-server- | |
- name: Build Test Server for Intel CPU | |
if: steps.cache_test_server.outputs.cache-hit != 'true' | |
working-directory: test-server | |
run: >- | |
swift build -c release --triple x86_64-apple-macosx 2>&1 | tee test-server-build-intel.log | |
- name: Build Test Server for M1 CPU | |
if: steps.cache_test_server.outputs.cache-hit != 'true' | |
working-directory: test-server | |
run: >- | |
swift build -c release --arch arm64 2>&1 | tee test-server-build-arm64.log | |
- name: Combine Test Server | |
working-directory: test-server | |
run: >- | |
lipo -create -output test-server-exec $(swift build --show-bin-path -c release --triple arm64-apple-macosx)/Run $(swift build --show-bin-path -c release --triple x86_64-apple-macosx)/Run | |
- name: Archiving DerivedData | |
uses: actions/upload-artifact@v4 | |
with: | |
name: test-server | |
path: | | |
./test-server/test-server-exec | |
- name: Archiving Raw Test Logs | |
uses: actions/upload-artifact@v4 | |
if: ${{ failure() || cancelled() }} | |
with: | |
name: test-server-build-log | |
path: | | |
test-server-build-intel.log | |
test-server-build-arm64.log | |
- name: Run CI Diagnostics | |
if: failure() | |
run: ./scripts/ci-diagnostics.sh | |
unit-tests: | |
name: Unit ${{matrix.name}} | |
runs-on: ${{matrix.runs-on}} | |
timeout-minutes: 20 | |
needs: build-test-server | |
strategy: | |
fail-fast: false | |
matrix: | |
# Can't run tests on watchOS because XCTest is not available | |
include: | |
# We are running tests on iOS 17 and later, as there were OS-internal changes introduced in succeeding versions. | |
# iOS 16 | |
- name: iOS 16 Sentry | |
runs-on: macos-13 | |
platform: "iOS" | |
xcode: "14.3.1" | |
test-destination-os: "16.4" | |
device: "iPhone 14" | |
scheme: "Sentry" | |
# iOS 17 | |
- name: iOS 17 Sentry | |
runs-on: macos-14 | |
platform: "iOS" | |
xcode: "15.4" | |
test-destination-os: "17.2" | |
device: "iPhone 15" | |
scheme: "Sentry" | |
# iOS 18 | |
- name: iOS 18 Sentry | |
runs-on: macos-15 | |
platform: "iOS" | |
xcode: "16.4" | |
test-destination-os: "18.5" | |
device: "iPhone 16" | |
scheme: "Sentry" | |
# We don't run the unit tests on macOS 13 cause we run them on all on GH actions available iOS versions. | |
# The chance of missing a bug solely on tvOS 16 that doesn't occur on iOS, macOS 12 or macOS 14 is minimal. | |
# We are running tests on macOS 14 and later, as there were OS-internal changes introduced in succeeding versions. | |
# macOS 14 | |
- name: macOS 14 Sentry | |
runs-on: macos-14 | |
platform: "macOS" | |
xcode: "15.4" | |
test-destination-os: "latest" | |
scheme: "Sentry" | |
# macOS 15 | |
- name: macOS 15 Sentry | |
runs-on: macos-15 | |
platform: "macOS" | |
xcode: "16.4" | |
test-destination-os: "latest" | |
scheme: "Sentry" | |
# Catalyst. We test the latest version, as the risk something breaking on Catalyst and not | |
# on an older iOS or macOS version is low. | |
# In addition we are running tests on macOS 14, as there were OS-internal changes introduced in succeeding versions. | |
- name: Catalyst 14 Sentry | |
runs-on: macos-14 | |
platform: "Catalyst" | |
xcode: "15.4" | |
test-destination-os: "latest" | |
scheme: "Sentry" | |
- name: Catalyst 15 Sentry | |
runs-on: macos-15 | |
platform: "Catalyst" | |
xcode: "16.4" | |
test-destination-os: "latest" | |
scheme: "Sentry" | |
# We don't run the unit tests on tvOS 16 cause we run them on all on GH actions available iOS versions. | |
# The chance of missing a bug solely on tvOS 16 that doesn't occur on iOS, tvOS 15 or tvOS 16 is minimal. | |
# We are running tests on tvOS 17 and latest, as there were OS-internal changes introduced in succeeding versions. | |
# tvOS 17 | |
- name: tvOS 17 Sentry | |
runs-on: macos-14 | |
platform: "tvOS" | |
xcode: "15.4" | |
test-destination-os: "17.5" | |
scheme: "Sentry" | |
# iOS 17 | |
- name: iOS 17 SentrySwiftUI | |
runs-on: macos-14 | |
platform: "iOS" | |
xcode: "15.4" | |
test-destination-os: "17.2" | |
device: "iPhone 15" | |
scheme: "SentrySwiftUI" | |
# tvOS 18 | |
- name: tvOS 18 Sentry | |
runs-on: macos-15 | |
platform: "tvOS" | |
xcode: "16.4" | |
test-destination-os: "18.5" | |
scheme: "Sentry" | |
steps: | |
- uses: actions/checkout@v5 | |
- uses: actions/download-artifact@v5 | |
with: | |
name: test-server | |
- name: Start Test Server | |
run: ./scripts/start-test-server.sh | |
- run: ./scripts/ci-select-xcode.sh ${{matrix.xcode}} | |
- name: Install Slather | |
run: gem install slather | |
# We split building and running tests in two steps so we know how long running the tests takes. | |
- name: Build tests | |
id: build_tests | |
run: | | |
./scripts/sentry-xcodebuild.sh \ | |
--platform ${{matrix.platform}} \ | |
--os ${{matrix.test-destination-os}} \ | |
--ref ${{ github.ref_name }} \ | |
--command build-for-testing \ | |
--device "${{matrix.device}}" \ | |
--configuration TestCI \ | |
--scheme ${{matrix.scheme}} | |
- name: Run tests | |
# We call a script with the platform so the destination | |
# passed to xcodebuild doesn't end up in the job name, | |
# because GitHub Actions don't provide an easy way of | |
# manipulating string in expressions. | |
run: | | |
./scripts/sentry-xcodebuild.sh \ | |
--platform ${{matrix.platform}} \ | |
--os ${{matrix.test-destination-os}} \ | |
--ref ${{ github.ref_name }} \ | |
--command test-without-building \ | |
--device "${{matrix.device}}" \ | |
--configuration TestCI \ | |
--scheme ${{matrix.scheme}} | |
- name: Publish Test Report | |
uses: mikepenz/action-junit-report@3585e9575db828022551b4231f165eb59a0e74e3 # v5.6.2 | |
if: always() | |
with: | |
report_paths: "build/reports/junit.xml" | |
fail_on_failure: true | |
fail_on_parse_error: true | |
detailed_summary: true | |
- name: Archiving DerivedData Logs | |
uses: actions/upload-artifact@v4 | |
if: steps.build_tests.outcome == 'failure' | |
with: | |
name: derived-data-${{matrix.platform}}-xcode-${{matrix.xcode}}-os-${{matrix.test-destination-os}} | |
path: | | |
/Users/runner/Library/Developer/Xcode/DerivedData/**/Logs/** | |
- name: Archiving Raw Logs | |
uses: actions/upload-artifact@v4 | |
if: ${{ failure() || cancelled() }} | |
with: | |
name: raw-output-${{matrix.platform}}-xcode-${{matrix.xcode}}-os-${{matrix.test-destination-os}} | |
path: | | |
raw-build-output.log | |
raw-build-for-testing-output.log | |
raw-test-output.log | |
- name: Archiving Crash Logs | |
uses: actions/upload-artifact@v4 | |
if: ${{ failure() || cancelled() }} | |
with: | |
name: crash-logs-${{matrix.platform}}-xcode-${{matrix.xcode}}-os-${{matrix.test-destination-os}} | |
path: | | |
~/Library/Logs/DiagnosticReports/** | |
- name: Gather code coverage information via slather | |
run: slather coverage --configuration TestCI --scheme Sentry | |
# We can upload all coverage reports, because codecov merges them. | |
# See https://docs.codecov.io/docs/merging-reports | |
# Checkout .codecov.yml to see the config of Codecov | |
# We don't upload codecov for release branches, as we don't want a failing coverage check to block a release. | |
# We don't upload codecov for scheduled runs as CodeCov only accepts a limited amount of uploads per commit. | |
- name: Push code coverage to codecov | |
id: codecov_1 | |
uses: codecov/codecov-action@fdcc8476540edceab3de004e990f80d881c6cc00 # [email protected] | |
if: ${{ contains(matrix.platform, 'iOS') && !contains(github.ref, 'release') && github.event.schedule == '' }} | |
with: | |
# Although public repos should not have to specify a token there seems to be a bug with the Codecov GH action, which can | |
# be solved by specifying the token, see https://github.com/codecov/codecov-action/issues/557#issuecomment-1224970469 | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: false | |
verbose: true | |
# Sometimes codecov uploads etc can fail. Retry one time to rule out e.g. intermittent network failures. | |
- name: Push code coverage to codecov | |
id: codecov_2 | |
uses: codecov/codecov-action@fdcc8476540edceab3de004e990f80d881c6cc00 # [email protected] | |
if: ${{ steps.codecov_1.outcome == 'failure' && contains(matrix.platform, 'iOS') && !contains(github.ref, 'release') && github.event.schedule == '' }} | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: true | |
verbose: true | |
- name: Codecov test analytics | |
if: ${{ !cancelled() && !contains(github.ref, 'release') && github.event.schedule == '' }} | |
uses: codecov/test-results-action@47f89e9acb64b76debcd5ea40642d25a4adced9f # [email protected] | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
verbose: true | |
name: sentry-cocoa-unit-tests | |
flags: unittests-${{ matrix.platform }}-${{ matrix.xcode }}-${{ matrix.test-destination-os }}, unittests | |
- name: Run CI Diagnostics | |
if: failure() | |
run: ./scripts/ci-diagnostics.sh | |
# This check validates that either all unit tests passed or were skipped, which allows us | |
# to make unit tests a required check with only running the unit tests when required. | |
# So, we don't have to run unit tests, for example, for Changelog or ReadMe changes. | |
unit-tests-required-check: | |
needs: | |
[ | |
files-changed, | |
build-test-server, | |
unit-tests, | |
] | |
name: Unit Tests | |
# This is necessary since a failed/skipped dependent job would cause this job to be skipped | |
if: always() | |
runs-on: ubuntu-latest | |
steps: | |
# If any jobs we depend on fails gets cancelled or times out, this job will fail. | |
# Skipped jobs are not considered failures. | |
- name: Check for failures | |
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') | |
run: | | |
echo "One of the unit test jobs has failed." && exit 1 |