name: Unit Tests on: push: branches: [master] pull_request: branches: [master] env: LC_CTYPE: en_US.UTF-8 LANG: en_US.UTF-8 jobs: swiftpm: runs-on: macos-15 steps: - uses: maxim-lobanov/setup-xcode@v1 with: xcode-version: ^16.4 - uses: actions/checkout@v4 - name: Run SwiftPM Tests run: swift test --enable-code-coverage --parallel - uses: sersoft-gmbh/swift-coverage-action@v4 id: coverage-files - uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} files: ${{ join(fromJSON(steps.coverage-files.outputs.files), ',') }} xcode: runs-on: macos-15 strategy: matrix: scheme: [Swift Tests] platform: - macOS - iOS - iPadOS - tvOS - visionOS skip-testing: [''] include: - scheme: iOS Tests platform: iOS skip-testing: 'iOS Tests/DDFileLoggerPerformanceTests' - scheme: OS X Tests platform: macOS skip-testing: 'OS X Tests/DDFileLoggerPerformanceTests' steps: - uses: maxim-lobanov/setup-xcode@v1 with: xcode-version: ^16.4 - name: Determine Xcode destination id: xcode-destination env: PLATFORM: ${{ matrix.platform }} run: | DESTINATION='' case "${PLATFORM}" in 'macOS') DESTINATION='platform=macOS';; 'iOS') DESTINATION='platform=iOS Simulator,OS=latest,name=iPhone 16 Pro';; 'iPadOS') DESTINATION='platform=iOS Simulator,OS=latest,name=iPad Pro 11-inch (M4)';; 'tvOS') DESTINATION='platform=tvOS Simulator,OS=latest,name=Apple TV 4K (3rd generation)';; 'watchOS') DESTINATION='platform=watchOS Simulator,OS=latest,name=Apple Watch Series 10 (46mm)';; 'visionOS') DESTINATION='platform=visionOS Simulator,OS=latest,name=Apple Vision Pro';; *) echo "::error title=Unknown platform!::Unknown platform: ${PLATFORM}" && exit 1;; esac echo "destination=${DESTINATION}" >> "${GITHUB_OUTPUT}" - name: Download visionOS if: ${{ matrix.platform == 'visionOS' }} run: | sudo xcodebuild -runFirstLaunch sudo xcrun simctl list # needed to boot the simulator sudo xcodebuild -downloadPlatform visionOS sudo xcodebuild -runFirstLaunch - uses: actions/checkout@v4 - uses: sersoft-gmbh/xcodebuild-action@v3 with: project: Tests/Tests.xcodeproj scheme: ${{ matrix.scheme }} destination: ${{ steps.xcode-destination.outputs.destination }} skip-testing: ${{ matrix.skip-testing }} enable-code-coverage: true parallel-testing-enabled: true build-settings: GCC_GENERATE_TEST_COVERAGE_FILES=YES action: test - uses: sersoft-gmbh/swift-coverage-action@v4 id: coverage-files - uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} files: ${{ join(fromJSON(steps.coverage-files.outputs.files), ',') }}