dotnet-core.yml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. name: Build & Test Terminal.Gui with .NET Core
  2. on:
  3. push:
  4. branches: [ v2_release, v2_develop ]
  5. paths-ignore:
  6. - '**.md'
  7. pull_request:
  8. branches: [ v2_release, v2_develop ]
  9. paths-ignore:
  10. - '**.md'
  11. jobs:
  12. build_and_test:
  13. runs-on: ubuntu-latest
  14. timeout-minutes: 10
  15. steps:
  16. - uses: actions/checkout@v4
  17. - name: Setup .NET Core
  18. uses: actions/setup-dotnet@v4
  19. with:
  20. dotnet-version: 8.x
  21. dotnet-quality: 'ga'
  22. - name: Install dependencies
  23. run: |
  24. dotnet restore
  25. - name: Build Debug
  26. run: dotnet build --configuration Debug --no-restore
  27. - name: Test
  28. run: |
  29. sed -i 's/"stopOnFail": false/"stopOnFail": true/g' UnitTests/xunit.runner.json
  30. dotnet test --verbosity normal --blame
  31. # dotnet test --no-restore --verbosity normal --collect:"XPlat Code Coverage" --settings UnitTests/coverlet.runsettings --blame
  32. mv -v UnitTests/TestResults/*/*.* UnitTests/TestResults/
  33. # Note: this step is currently not writing to the gist for some reason
  34. # - name: Create Test Coverage Badge
  35. # uses: simon-k/[email protected]
  36. # id: create_coverage_badge
  37. # with:
  38. # label: Unit Test Coverage
  39. # color: brightgreen
  40. # path: UnitTests/TestResults/coverage.opencover.xml
  41. # gist-filename: code-coverage.json
  42. # # https://gist.github.com/migueldeicaza/90ef67a684cb71db1817921a970f8d27
  43. # gist-id: 90ef67a684cb71db1817921a970f8d27
  44. # gist-auth-token: ${{ secrets.GIST_AUTH_TOKEN }}
  45. # - name: Print Code Coverage
  46. # run: |
  47. # echo "Code coverage percentage: ${{steps.create_coverage_badge.outputs.percentage}}%"
  48. # echo "Badge data: ${{steps.create_coverage_badge.outputs.badge}}"