| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- 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 15 Pro';;
- 'iPadOS') DESTINATION='platform=iOS Simulator,OS=latest,name=iPad Pro (11-inch) (4th generation)';;
- 'tvOS') DESTINATION='platform=tvOS Simulator,OS=latest,name=Apple TV 4K (3rd generation)';;
- 'watchOS') DESTINATION='platform=watchOS Simulator,OS=latest,name=Apple Watch Series 9 (45mm)';;
- '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), ',') }}
|