| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- 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@v5
- - 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: Install Platform
- if: ${{ matrix.platform != 'macOS' }}
- env:
- PLATFORM: ${{ matrix.platform }}
- run: |
- if [ "${PLATFORM}" = 'iPadOS' ]; then
- PLATFORM='iOS'
- fi
- xcrun simctl delete unavailable # Remove unavailable sims - also boots the simulator
- xcodebuild -downloadPlatform "${PLATFORM}"
- - uses: actions/checkout@v5
- - 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), ',') }}
|