test taplo #81
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
on: | |
push: | |
branches: | |
- main | |
- dev | |
pull_request: | |
branches: | |
- main | |
- dev | |
name: Rustfmt + Taplo | |
jobs: | |
fmt: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: | |
- macos-latest | |
- ubuntu-latest | |
include: | |
- os: macos-latest | |
target: x86_64-apple-darwin | |
- os: ubuntu-latest | |
target: x86_64-unknown-linux-musl | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: nightly | |
override: true | |
components: rustfmt | |
- name: Install Taplo | |
run: cargo install taplo-cli | |
- name: Run fmt in different workspaces and crates | |
run: | | |
cargo fmt --all --manifest-path=benches/Cargo.toml -- --check | |
cargo fmt --all --manifest-path=common/Cargo.toml -- --check | |
cargo fmt --all --manifest-path=protocols/Cargo.toml -- --check | |
cargo fmt --all --manifest-path=roles/Cargo.toml -- --check | |
cargo fmt --all --manifest-path=utils/Cargo.toml -- --check | |
cargo fmt --all --manifest-path=utils/message-generator/Cargo.toml -- --check | |
- name: Notify PR author if rustfmt fails | |
if: failure() | |
uses: peter-evans/create-or-update-comment@v2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
issue-number: ${{ github.event.pull_request.number }} | |
body: | | |
⚠️ The Rust files in this PR are not properly formatted. Please run `cargo +nightly fmt` to format the files and push the changes. | |
- name: Run Taplo check | |
id: taplo-check | |
run: taplo fmt --check | |
continue-on-error: true | |
- name: Notify PR author if Taplo formatting fails | |
if: failure() | |
uses: peter-evans/create-or-update-comment@v2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
issue-number: ${{ github.event.pull_request.number }} | |
body: | | |
⚠️ The `Cargo.toml` file(s) in this PR are not properly formatted. Please run `taplo fmt` to format the files and push the changes. |