| name: Formatting |
| |
| on: |
| workflow_dispatch: |
| pull_request: |
| branches: |
| - '**' |
| merge_group: |
| branches: [ main ] |
| # schedule: |
| # - cron: "0 0 * * *" |
| |
| concurrency: |
| group: ${{ github.workflow }}-${{ github.ref }} |
| cancel-in-progress: true |
| |
| jobs: |
| formatting-checks: |
| runs-on: ubuntu-22.04 |
| |
| steps: |
| - uses: actions/checkout@v4 |
| |
| - name: Setup dotnet |
| uses: actions/setup-dotnet@v4 |
| with: |
| dotnet-version: '9.0.x' |
| |
| - name: Setup Python environment (for pre-commit) |
| uses: actions/setup-python@v5 |
| with: |
| python-version: '3.10' |
| |
| - name: Clean dotnet temporary folder |
| run: | |
| sudo rm -rf /tmp/.dotnet |
| |
| - name: Install pre-commit and dependencies |
| run: | |
| pip install pre-commit |
| pre-commit install-hooks |
| |
| - name: Run pre-commit checks |
| env: |
| TMPDIR: ${{ runner.temp }} |
| DOTNET_CLI_HOME: ${{ runner.temp }} |
| run: | |
| pre-commit run --all-files |