-
Notifications
You must be signed in to change notification settings - Fork 381
75 lines (61 loc) · 1.95 KB
/
static-analysis.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Static Analysis
on: [push, workflow_dispatch]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
jobs:
fmt:
if: github.event.pull_request.draft == false
runs-on: [self-hosted, Linux, X64]
steps:
- name: Checkout the source code
uses: actions/checkout@v3
- name: Install deps
run: sudo apt -y install protobuf-compiler
- name: Install & display rust toolchain
run: rustup show
- name: Check targets are installed correctly
run: rustup target list --installed
- name: Check fmt
run: cargo fmt -- --check
- name: Check Cargo.toml format
run: |
if taplo --version &> /dev/null; then
echo "taplo-cli is already installed"
else
cargo install taplo-cli
fi
taplo fmt --check
clippy:
if: github.event.pull_request.draft == false
runs-on: [self-hosted, Linux, X64]
steps:
- name: Checkout the source code
uses: actions/checkout@v3
- name: Install deps
run: sudo apt -y install protobuf-compiler
- name: free disk space
run: |
sudo swapoff -a
sudo rm -f /swapfile
sudo apt clean
- name: Install & display rust toolchain
run: rustup show
- name: Check targets are installed correctly
run: rustup target list --installed
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --features try-runtime,runtime-benchmarks -- -D warnings
check-license:
if: github.event.pull_request.draft == false
runs-on: [self-hosted, Linux, X64]
steps:
- name: Checkout the source code
uses: actions/checkout@v3
- name: Check license
uses: viperproject/check-license-header@v2
with:
path: ./
config: ./.github/license-check/config.json
strict: false