Steam Frame fixes #4277
Workflow file for this run
This file contains hidden or 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
| --- | |
| # yamllint disable rule:line-length | |
| name: pre-commit | |
| on: # yamllint disable-line rule:truthy | |
| pull_request: | |
| push: | |
| branches: | |
| - main # We never expect this to fail, since it must have passed on the pull request, but this will let us create a cache on main that other PRs can use, speeding up the process | |
| jobs: | |
| pre-commit: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-dotnet@v6.0.0 | |
| with: | |
| dotnet-version: '8.0.x' | |
| - uses: actions/setup-go@v7 # One of our hooks (gitleaks) needs a newer Go version than we get from the runner | |
| with: | |
| go-version: '>=1.25.4' | |
| cache: false | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: "false" | |
| - name: Install prek | |
| run: uv tool install prek | |
| shell: bash | |
| - name: Cache pre-commit environments | |
| uses: actions/cache@v6 | |
| with: | |
| path: ~/.cache/prek | |
| key: prek|${{ hashFiles('.pre-commit-config.yaml') }} | |
| - name: Setup prek environments (separate step for timing purposes) | |
| run: prek run | |
| - name: Run prek dotnet-format, with retries | |
| uses: Wandalen/wretry.action@v3 | |
| with: | |
| command: prek run dotnet-format --show-diff-on-failure --color=always --all-files || { git checkout -- . ; exit 1 ; } # In case dotnet-format fails, reset the changes it made. This way, we can differentiate between a NuGet failure and a real formatting issue | |
| - name: Remove dotnet-format from the list of prek jobs to run (since we already ran it) | |
| run: yq eval 'del(.repos[] | select(.hooks[].id == "dotnet-format"))' -i .pre-commit-config.yaml | |
| - name: Run the rest of pre-commit | |
| run: prek run --show-diff-on-failure --color=always --all-files |