Fix build #229
Workflow file for this run
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: Fmt and Clippy | |
# Run 'rustfmt' and 'clippy' linting. | |
on: | |
push: | |
branches: main | |
pull_request: | |
branches: main | |
workflow_dispatch: # allow manual trigger | |
env: | |
RUST_TOOLCHAIN_FMT: nightly-2023-04-01-x86_64-unknown-linux-gnu | |
RUST_TOOLCHAIN: 1.66 | |
jobs: | |
fmt: | |
name: lint:fmt | |
# Skip for draft pull requests. | |
if: ${{ !github.event.pull_request.draft }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install Rust | |
run: | | |
rustup override set "${{ env.RUST_TOOLCHAIN_FMT }}" | |
rustup component add rustfmt | |
- name: Format | |
run: | | |
cargo fmt -- --color=always --check | |
- name: Format (query-account) | |
run: | | |
cargo fmt --manifest-path=./tools/query-account/Cargo.toml -- --color=always --check | |
- name: Format (transfer-client) | |
run: | | |
cargo fmt --manifest-path=./tools/transfer-client/Cargo.toml -- --color=always --check | |
- name: Format (transfer-client-direct) | |
run: | | |
cargo fmt --manifest-path=./tools/transfer-client-direct/Cargo.toml -- --color=always --check | |
clippy: | |
name: lint:clippy | |
needs: fmt | |
# Skip for draft pull requests. | |
if: ${{ !github.event.pull_request.draft }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install protobuf | |
run: | | |
wget https://github.com/protocolbuffers/protobuf/releases/download/v3.15.3/protoc-3.15.3-linux-x86_64.zip | |
unzip protoc-3.15.3-linux-x86_64.zip | |
sudo mv ./bin/protoc /usr/bin/protoc | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Install Rust | |
run: | | |
rustup override set "${{ env.RUST_TOOLCHAIN }}" | |
rustup component add clippy | |
- name: Clippy | |
run: | | |
cargo clippy --color=always --tests --benches -- -Dclippy::all | |
- name: Clippy (query-account) | |
run: | | |
cargo clippy --color=always --tests --benches --manifest-path=./tools/query-account/Cargo.toml -- -Dclippy::all | |
- name: Clippy (transfer-client) | |
run: | | |
cargo clippy --color=always --tests --benches --manifest-path=./tools/transfer-client/Cargo.toml -- -Dclippy::all | |
- name: Clippy (transfer-client-direct) | |
run: | | |
cargo clippy --color=always --tests --benches --manifest-path=./tools/transfer-client-direct/Cargo.toml -- -Dclippy::all |