Remove redundant tasks and clean up imports #687
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# This workflow runs the dotnet formatter on all c-sharp code. | |
# | |
name: dotnet format | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
check-format: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '7.0.x' | |
- name: Restore dotnet tools | |
run: dotnet tool restore | |
- name: Check format | |
run: dotnet format --verify-no-changes --verbosity detailed | |
- name: Fail if files are not formatted | |
if: ${{ failure() }} | |
run: | | |
echo "Some files are not formatted correctly. Run 'dotnet format' to fix." | |
exit 1 |