forked from Concordium/concordium-node
-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (52 loc) · 1.73 KB
/
rustfmt.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
# Workflow triggered by pushes to the master branch and PRs targeting it
# (as long as the commits contain Rust code changes).
# The workflow consists of the single job 'rustfmt'
# which checks formatting of the Rust sources using the 'rustfmt' tool.
# The job is skipped if the workflow was triggered by a PR
# marked as a draft.
name: Run rustfmt
on:
push:
branches: main
paths:
- '.github/workflows/rustfmt.yaml'
- 'concordium-node/rustfmt.toml'
- '**.rs'
pull_request:
branches: main
types: [opened, synchronize, reopened, ready_for_review]
paths:
- '.github/workflows/rustfmt.yaml'
- 'concordium-node/rustfmt.toml'
- '**.rs'
workflow_dispatch: # allow manual trigger
env:
CARGO_TERM_COLOR: always # implicitly adds '--color=always' to all cargo commands
jobs:
rustfmt:
runs-on: ubuntu-latest
if: ${{ !github.event.pull_request.draft }}
strategy:
matrix:
plan:
# from concordium/rustfmt:0.17
- rust: "nightly-2021-06-09-x86_64-unknown-linux-gnu"
steps:
- name: Checkout
uses: actions/checkout@v2
with:
# token: ${{ secrets.CONCORDIUM_CI }}
submodules: recursive
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.plan.rust }}
override: true
components: rustfmt
- name: Run rustfmt
run: |
cargo fmt --manifest-path concordium-node/Cargo.toml --all -- --check
cargo fmt --manifest-path collector-backend/Cargo.toml --all -- --check
cargo fmt --manifest-path service/windows/Cargo.toml --all -- --check
cargo fmt --manifest-path service/windows/installer/custom-actions/Cargo.toml --all -- --check