-
Notifications
You must be signed in to change notification settings - Fork 1
75 lines (68 loc) · 2.43 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
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.73"
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