dotnet-core.yml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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: |
  18. dotnet restore
  19. - name: Build Debug
  20. run: dotnet build --configuration Debug --no-restore
  21. - name: Test
  22. run: |
  23. dotnet test --no-restore --verbosity normal --collect:"XPlat Code Coverage" --settings UnitTests/coverlet.runsettings
  24. mv -v UnitTests/TestResults/*/*.* UnitTests/TestResults/
  25. # Note: this step is currently not writing to the gist for some reason
  26. - name: Create Test Coverage Badge
  27. uses: simon-k/[email protected]
  28. id: create_coverage_badge
  29. with:
  30. label: Unit Test Coverage
  31. color: brightgreen
  32. path: UnitTests/TestResults/coverage.opencover.xml
  33. gist-filename: code-coverage.json
  34. # https://gist.github.com/migueldeicaza/90ef67a684cb71db1817921a970f8d27
  35. gist-id: 90ef67a684cb71db1817921a970f8d27
  36. gist-auth-token: ${{ secrets.GIST_AUTH_TOKEN }}
  37. - name: Print Code Coverage
  38. run: |
  39. echo "Code coverage percentage: ${{steps.create_coverage_badge.outputs.percentage}}%"
  40. echo "Badge data: ${{steps.create_coverage_badge.outputs.badge}}"