| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- 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-13
- steps:
- - uses: maxim-lobanov/setup-xcode@v1
- with:
- xcode-version: ^14.3
- - 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@v3
- with:
- token: ${{ secrets.CODECOV_TOKEN }}
- files: ${{ join(fromJSON(steps.coverage-files.outputs.files), ',') }}
- xcode:
- runs-on: macos-13
- strategy:
- matrix:
- scheme: [ Swift Tests ]
- platform:
- - macOS
- - iOS
- - iPadOS
- - tvOS
- 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: ^14.3
- - 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 14 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 8 (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}"
- - 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@v3
- with:
- token: ${{ secrets.CODECOV_TOKEN }}
- files: ${{ join(fromJSON(steps.coverage-files.outputs.files), ',') }}
|