unit-tests.yml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. name: Unit Tests
  2. on:
  3. push:
  4. branches: [ master ]
  5. pull_request:
  6. branches: [ master ]
  7. env:
  8. LC_CTYPE: en_US.UTF-8
  9. LANG: en_US.UTF-8
  10. jobs:
  11. swiftpm:
  12. runs-on: macos-latest
  13. steps:
  14. - uses: actions/checkout@v2
  15. - run: ./Scripts/ci-select-xcode.sh
  16. - name: Run SwiftPM Tests
  17. run: swift test --enable-code-coverage --parallel
  18. - name: Generate Coverage Files
  19. run: xcrun llvm-cov export -format="lcov" .build/debug/*PackageTests.xctest/Contents/MacOS/*PackageTests -instr-profile .build/debug/codecov/default.profdata > coverage.lcov
  20. - uses: codecov/codecov-action@v1
  21. with:
  22. file: coverage.lcov
  23. token: ${{secrets.CODECOV_TOKEN}}
  24. xcode:
  25. runs-on: macos-latest
  26. strategy:
  27. matrix:
  28. scheme: [Swift Tests]
  29. destination:
  30. - platform=macOS
  31. - platform=iOS Simulator,OS=latest,name=iPhone 11 Pro
  32. skip-testing: ['']
  33. include:
  34. - scheme: iOS Tests
  35. destination: 'platform=iOS Simulator,name=iPhone 11 Pro,OS=latest'
  36. skip-testing: 'iOS Tests/DDFileLoggerPerformanceTests'
  37. - scheme: OS X Tests
  38. destination: 'platform=macosx'
  39. skip-testing: 'OS X Tests/DDFileLoggerPerformanceTests'
  40. steps:
  41. - uses: actions/checkout@v2
  42. - run: ./Scripts/ci-select-xcode.sh
  43. - uses: sersoft-gmbh/xcodebuild-action@v1
  44. with:
  45. project: Tests/Tests.xcodeproj
  46. scheme: ${{matrix.scheme}}
  47. destination: ${{matrix.destination}}
  48. skip-testing: ${{matrix.skip-testing}}
  49. build-settings: GCC_GENERATE_TEST_COVERAGE_FILES=YES
  50. action: test
  51. - uses: codecov/codecov-action@v1
  52. with:
  53. token: ${{secrets.CODECOV_TOKEN}}