If nightly or pr check is going slowly inform user #800
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
name: rustfmt | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
workflow_dispatch: | |
# https://github.com/reviewdog/action-suggester?tab=readme-ov-file#required-permissions | |
permissions: | |
contents: read | |
checks: write | |
issues: write | |
pull-requests: write | |
jobs: | |
rustfmt: | |
name: Rustfmt Check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Rust | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
components: rustfmt | |
- name: Rustfmt check | |
if: ${{ github.event_name != 'pull_request' }} | |
run: cargo fmt -- --check -v | |
- name: Rustfmt PR | |
if: ${{ github.event_name == 'pull_request' }} | |
run: cargo fmt -- -v | |
- name: Suggest format changes | |
if: ${{ github.event_name == 'pull_request' }} | |
uses: reviewdog/action-suggester@v1 | |
with: | |
tool_name: rustfmt | |
fail_on_error: true |