dotnet-core.yml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. name: Build & Test Terminal.Gui with .NET Core
  2. on:
  3. push:
  4. branches: [ main, develop ]
  5. pull_request:
  6. branches: [ main, develop ]
  7. jobs:
  8. build:
  9. runs-on: ubuntu-latest
  10. steps:
  11. - uses: actions/checkout@v3
  12. - name: Setup .NET Core
  13. uses: actions/[email protected]
  14. with:
  15. dotnet-version: 6.0.100
  16. - name: Install dependencies
  17. run: dotnet restore
  18. - name: Build Debug
  19. run: dotnet build --configuration Debug --no-restore
  20. - name: Test
  21. run: |
  22. dotnet test --no-restore --verbosity normal --collect:"XPlat Code Coverage" --settings UnitTests/coverlet.runsettings
  23. mv -v UnitTests/TestResults/*/*.* UnitTests/TestResults/
  24. # Note: this step is currently not writing to the gist for some reason
  25. - name: Create Test Coverage Badge
  26. uses: simon-k/[email protected]
  27. id: create_coverage_badge
  28. with:
  29. label: Unit Test Coverage
  30. color: brightgreen
  31. path: UnitTests/TestResults/coverage.opencover.xml
  32. gist-filename: code-coverage.json
  33. # https://gist.github.com/migueldeicaza/90ef67a684cb71db1817921a970f8d27
  34. gist-id: 90ef67a684cb71db1817921a970f8d27
  35. gist-auth-token: ${{ secrets.GIST_AUTH_TOKEN }}
  36. - name: Print Code Coverage
  37. run: |
  38. echo "Code coverage percentage: ${{steps.create_coverage_badge.outputs.percentage}}%"
  39. echo "Badge data: ${{steps.create_coverage_badge.outputs.badge}}"