diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index c8a9073..5fbb319 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -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 diff --git a/Package.swift b/Package.swift index 5e26c34..6c6a169 100644 --- a/Package.swift +++ b/Package.swift @@ -35,18 +35,12 @@ 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( @@ -54,9 +48,6 @@ let package = Package( dependencies: [ .init(stringLiteral: targetName), .init(stringLiteral: exampleModuleName) - ], - swiftSettings: [ - .treatAllWarnings(as: .error) ] ), ],