Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/actions/create_sim/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: 'Create iOS Simulator'

inputs:
name:
description: 'Name of created simulator'
required: true
device:
description: "Device, e.g. 'iPhone 11'"
required: true
system:
description: "System, e.g. 'iOS17.4'"
required: true

outputs:
uuid:
description: 'UUID of created simulator'
value: ${{ steps.create.outputs.uuid }}

runs:
using: "composite"

steps:
- name: Create
id: create
shell: bash
run: |
uuid=$(xcrun simctl create "${{ inputs.name }}" "${{ inputs.device }}" "${{ inputs.system }}")
xcrun simctl boot $uuid
echo "uuid=$uuid" >> $GITHUB_OUTPUT
75 changes: 54 additions & 21 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,40 +11,73 @@ concurrency:

jobs:
tests:
runs-on: 'macos-15'
runs-on: 'macos-26'

timeout-minutes: 15

env:
SCHEME: "BlackBoxFirebasePerformance"
OS_VERSION: "26.2"

strategy:
matrix:
DESTINATION: ["platform=iOS Simulator,name=iPhone 16", "platform=tvOS Simulator,name=Apple TV"]
include:
- destination: "platform=iOS Simulator"
platform: ios
device: "iPhone 16"
system_prefix: "iOS"
- destination: "platform=OS X"
platform: macos
- destination: "platform=tvOS Simulator"
platform: tvos
device: "Apple TV"
system_prefix: "tvOS"
- destination: "platform=watchOS Simulator"
platform: watchos
device: "Apple Watch Ultra 2 (49mm)"
system_prefix: "watchOS"

steps:
- name: Get source code
uses: actions/checkout@v6
- name: Get source code
uses: actions/checkout@v6

- name: Prepare Environment for App Build
uses: ./.github/actions/prepare_env_app_build
- name: Prepare Environment for App Build
uses: ./.github/actions/prepare_env_app_build

- name: Resolve Dependencies
run: xcodebuild -resolvePackageDependencies
- name: Resolve Dependencies
run: xcodebuild -resolvePackageDependencies

- name: Create Simulator
id: create_simulator
if: matrix.platform != 'macos'
uses: ./.github/actions/create_sim
with:
name: ${{ matrix.device }}
device: ${{ matrix.device }}
system: ${{ matrix.system_prefix }}${{ env.OS_VERSION }}

- name: Select Destination
id: select-destination
run: |
if [ "${{ matrix.platform }}" = "macos" ]; then
echo "dest=${{ matrix.destination }}" >> $GITHUB_OUTPUT
else
echo "dest=${{ matrix.destination }},id=${{ steps.create_simulator.outputs.uuid }}" >> $GITHUB_OUTPUT
fi

- name: Build
run: >
xcodebuild build-for-testing
-scheme ${{ env.SCHEME }}
-destination '${{ matrix.DESTINATION }}'
-quiet

- name: Test
run: >
xcodebuild test-without-building
-scheme ${{ env.SCHEME }}
-destination '${{ matrix.DESTINATION }}'
-quiet
- name: Build
run: >
xcodebuild build-for-testing
-scheme ${{ env.SCHEME }}
-destination '${{ steps.select-destination.outputs.dest }}'
-quiet

- name: Test
run: >
xcodebuild test-without-building
-scheme ${{ env.SCHEME }}
-destination '${{ steps.select-destination.outputs.dest }}'
-quiet

# This allows us to have a branch protection rule for tests and deploys with matrix
status-for-matrix:
Expand Down
2 changes: 1 addition & 1 deletion .xcode-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16
26
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
// Copyright © 2021 Dodo Pizza. All rights reserved.
//

#if canImport(FirebasePerformance) && (os(iOS) || os(tvOS)) && !targetEnvironment(macCatalyst)

import Foundation
import BlackBox
import DBThreadSafe
Expand Down Expand Up @@ -159,3 +161,20 @@ extension FirebasePerformanceLogger {
return name
}
}

#else

import Foundation
import BlackBox

@available(*, unavailable, message: "FirebasePerformanceLogger is only available on iOS and tvOS when Firebase Performance SDK is present.")
public final class FirebasePerformanceLogger: BBLoggerProtocol {
public init(levels: [BBLogLevel]) {}

public func log(_ event: BlackBox.ErrorEvent) {}
public func log(_ event: BlackBox.GenericEvent) {}
public func logStart(_ event: BlackBox.StartEvent) {}
public func logEnd(_ event: BlackBox.EndEvent) {}
}

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import XCTest
import BlackBox
import FirebasePerformance
@testable import BlackBoxFirebasePerformance

class BlackBoxFirebasePerformanceTests: XCTestCase {
Expand Down