checks.yml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. name: Perform checks
  2. on:
  3. pull_request:
  4. branches: [ master ]
  5. paths:
  6. - '**'
  7. - '!.github/**'
  8. - '!*.yml'
  9. - '!*.config'
  10. - '!*.md'
  11. - '.github/workflows/*.yml'
  12. permissions:
  13. pull-requests: write
  14. checks: write
  15. concurrency:
  16. group: pr-checks-${{ github.event.number }}
  17. cancel-in-progress: true
  18. jobs:
  19. format:
  20. runs-on: ubuntu-latest
  21. steps:
  22. - uses: actions/checkout@v4
  23. with:
  24. fetch-depth: 0
  25. - uses: actions/setup-dotnet@v4
  26. with:
  27. global-json-file: global.json
  28. - name: Overwrite csc problem matcher
  29. run: echo "::add-matcher::.github/csc.json"
  30. - run: dotnet restore
  31. - name: Print dotnet format version
  32. run: dotnet format --version
  33. - name: Run dotnet format whitespace
  34. run: |
  35. dotnet format whitespace --verify-no-changes --report ./whitespace-report.json -v d
  36. # For some unknown reason this step sometimes fails with exit code 139 (segfault?),
  37. # so in that case we'll try again (3 tries max).
  38. - name: Run dotnet format style
  39. uses: TSRBerry/unstable-commands@v1
  40. with:
  41. commands: dotnet format style --severity info --verify-no-changes --report ./style-report.json -v d
  42. timeout-minutes: 5
  43. retry-codes: 139
  44. # For some unknown reason this step sometimes fails with exit code 139 (segfault?),
  45. # so in that case we'll try again (3 tries max).
  46. - name: Run dotnet format analyzers
  47. uses: TSRBerry/unstable-commands@v1
  48. with:
  49. commands: dotnet format analyzers --severity info --verify-no-changes --report ./analyzers-report.json -v d
  50. timeout-minutes: 5
  51. retry-codes: 139
  52. - name: Upload report
  53. if: failure()
  54. uses: actions/upload-artifact@v4
  55. with:
  56. name: dotnet-format
  57. path: ./*-report.json
  58. pr_build:
  59. uses: ./.github/workflows/build.yml
  60. needs: format
  61. secrets: inherit