forked from gattaca-com/helix
-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (48 loc) · 1.55 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Linting
on:
push:
branches: [ main, develop, "release/**", "taiyi" ]
pull_request:
branches: [ main, develop, "release/**", "taiyi" ]
env:
CARGO_TERM_COLOR: always
jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
path: ./repos/${{ secrets.REPO_NAME }}
ref: ${{ github.ref }}
# Install Protocol Buffers Compiler
- name: Install Protobuf Compiler (protoc)
run: sudo apt-get install -y protobuf-compiler
- name: Change to project directory
run: cd ./repos/${{ secrets.REPO_NAME }}
# Install rust toolchain and rustfmt
- name: Install rust toolchain and components
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
# Run General Clippy Linting
- name: Clippy
run: cargo clippy --all-features --no-deps
env:
RUSTFLAGS: -D warnings
working-directory: ./repos/${{ secrets.REPO_NAME }}
# Check Code Formatting
- name: Rustfmt
run: cargo +nightly fmt --all --check
working-directory: ./repos/${{ secrets.REPO_NAME }}
# Check Documentation
- name: Docs
run: cargo doc --workspace --all-features --no-deps
env:
RUSTDOCFLAGS: --cfg docsrs --show-type-layout --generate-link-to-definition --enable-index-page -Zunstable-options -D warnings
working-directory: ./repos/${{ secrets.REPO_NAME }}