-
-
Notifications
You must be signed in to change notification settings - Fork 2
53 lines (51 loc) · 1.28 KB
/
formatter.yml
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
name: Formatter
on:
push:
branches: [master]
pull_request:
branches: [master]
permissions:
contents: write # for checkout
pull-requests: write # for comments
jobs:
format:
name: Format apply
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Automatically apply lint suggestions
uses: actions-rs/cargo@v1
with:
command: clippy
args: --fix --workspace
- name: Format check packages
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Apply formatting changes
branch: ${{ github.head_ref }}
check:
name: Format check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Run clippy check on workspace
uses: actions-rs/cargo@v1
with:
command: clippy
args: --workspace
- name: Format all packages
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all