-
Notifications
You must be signed in to change notification settings - Fork 1
39 lines (36 loc) · 968 Bytes
/
lint.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
name: Linters
on: [ push, workflow_dispatch ]
env:
CARGO_TERM_COLOR: always
jobs:
lint:
name: Lint & Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt, clippy
override: true
- name: Cache Cargo
uses: Swatinem/[email protected]
- name: Lint
uses: actions-rs/cargo@v1
with:
command: fix
args: --all-features
- name: Format
uses: actions-rs/cargo@v1
with:
command: fmt
- name: Upload formatting and lint fixes
run: |
if [ -n "$(git status --porcelain)" ]
then
git config user.name "Upload lint fixes from CI"
git config user.email ""
git add .
git commit -m "Automically fix lint failures and format code."
git push
fi