checks.yml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. name: Perform checks
  2. on:
  3. pull_request:
  4. branches: [ master ]
  5. paths:
  6. - '**'
  7. - '!.github/**'
  8. - '!*.yml'
  9. - '!*.config'
  10. - '!README.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@v3
  23. with:
  24. fetch-depth: 0
  25. - uses: actions/setup-dotnet@v3
  26. with:
  27. global-json-file: global.json
  28. - run: dotnet restore
  29. - name: Print dotnet format version
  30. run: dotnet format --version
  31. - name: Run dotnet format whitespace
  32. run: |
  33. dotnet format whitespace --verify-no-changes --report ./whitespace-report.json -v d
  34. # For some unknown reason this step sometimes fails with exit code 139 (segfault?),
  35. # so in that case we'll try again (3 tries max).
  36. - name: Run dotnet format style
  37. uses: TSRBerry/unstable-commands@v1
  38. with:
  39. commands: dotnet format style --severity info --verify-no-changes --report ./style-report.json -v d
  40. timeout-minutes: 5
  41. retry-codes: 139
  42. # For some unknown reason this step sometimes fails with exit code 139 (segfault?),
  43. # so in that case we'll try again (3 tries max).
  44. - name: Run dotnet format analyzers
  45. uses: TSRBerry/unstable-commands@v1
  46. with:
  47. commands: dotnet format analyzers --severity info --verify-no-changes --report ./analyzers-report.json -v d
  48. timeout-minutes: 5
  49. retry-codes: 139
  50. - name: Upload report
  51. if: failure()
  52. uses: actions/upload-artifact@v3
  53. with:
  54. name: dotnet-format
  55. path: ./*-report.json
  56. pr_build:
  57. uses: ./.github/workflows/build.yml
  58. needs: format
  59. secrets: inherit