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
31 changes: 25 additions & 6 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,40 @@ jobs:

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


- name: Create iOS simulator
if: startsWith(matrix.DESTINATION, 'platform=iOS Simulator')
id: create_ios_simulator
run: |
runtime=$(xcrun simctl list runtimes available | grep -Eo 'com\.apple\.CoreSimulator\.SimRuntime\.iOS-[0-9-]+' | tail -n1)
uuid=$(xcrun simctl create "BlackBox-CI-iPhone" "iPhone 16" "$runtime")
xcrun simctl boot "$uuid"
echo "destination=platform=iOS Simulator,id=$uuid" >> "$GITHUB_OUTPUT"

- name: Build
run: >
xcodebuild build-for-testing
-scheme ${{ env.SCHEME }}
-destination '${{ matrix.DESTINATION }}'
run: |
destination='${{ matrix.DESTINATION }}'
if [[ -n '${{ steps.create_ios_simulator.outputs.destination }}' ]]; then
destination='${{ steps.create_ios_simulator.outputs.destination }}'
fi

xcodebuild build-for-testing \
-scheme ${{ env.SCHEME }} \
-destination "$destination" \
-quiet

- name: Test
id: test
run: |
xcresult="${{ env.SCHEME }}-${{ matrix.DESTINATION }}.xcresult"
destination='${{ matrix.DESTINATION }}'
if [[ -n '${{ steps.create_ios_simulator.outputs.destination }}' ]]; then
destination='${{ steps.create_ios_simulator.outputs.destination }}'
fi

xcodebuild test-without-building \
-scheme ${{ env.SCHEME }} \
-destination '${{ matrix.DESTINATION }}' \
-destination "$destination" \
-resultBundlePath "$xcresult" \
-quiet

Expand Down
9 changes: 0 additions & 9 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,28 +35,19 @@ let package = Package(
name: targetName,
dependencies: [
.product(name: "DBThreadSafe", package: "DBThreadSafe-ios")
],
swiftSettings: [
.treatAllWarnings(as: .error)
]
),
.target(
name: exampleModuleName,
dependencies: [
.init(stringLiteral: targetName)
],
swiftSettings: [
.treatAllWarnings(as: .error)
]
),
.testTarget(
name: testsTargetName,
dependencies: [
.init(stringLiteral: targetName),
.init(stringLiteral: exampleModuleName)
],
swiftSettings: [
.treatAllWarnings(as: .error)
]
),
],
Expand Down