Repository navigation
bump(cargo)!: 🚀 upgrades available #6305
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
| # Make sure Rust source code is consistently formatted with rustfmt. | |
| # | |
| # Uses the nix-shell environment to ensure the same rustfmt version | |
| # that developers use locally. | |
| name: "lint-cargo-fmt.yml" | |
| on: | |
| pull_request: {} | |
| merge_group: | |
| types: ["checks_requested"] | |
| concurrency: | |
| group: "${{ github.workflow }}:${{ github.event.pull_request.number || github.event.after || github.event.merge_group && github.run_id }}" | |
| cancel-in-progress: true | |
| permissions: | |
| contents: "read" | |
| jobs: | |
| format-check: | |
| name: "Check formatting for Rust code" | |
| runs-on: "lab" | |
| # Skip this job in merge group checks; but we need the workflow to run, | |
| # given that the status check is required for merging. | |
| if: "${{ github.event.pull_request }}" | |
| env: | |
| USER: "runner" | |
| steps: | |
| - name: "Checkout" | |
| uses: "actions/checkout@v6" | |
| with: | |
| fetch-depth: "1" | |
| persist-credentials: "false" | |
| - uses: "./.github/actions/nix-shell" | |
| with: | |
| cachix_signing_key: "${{ secrets.CACHIX_SIGNING_KEY }}" | |
| cachix_auth_token: "${{ secrets.CACHIX_AUTH_TOKEN }}" | |
| - name: "Check formatting" | |
| shell: "bash" | |
| run: | | |
| set -euo pipefail | |
| just fmt --check | |
| - name: "How to fix" | |
| if: ${{ failure() }} | |
| run: | | |
| echo "::notice::Try fixing the issue with 'cargo fmt --all', then commit the changes." |