-
Notifications
You must be signed in to change notification settings - Fork 9
69 lines (58 loc) · 1.83 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
59
60
61
62
63
64
65
66
67
68
69
name: Lint
on: [push, pull_request]
env:
CARGO_TERM_COLOR: always
jobs:
format:
name: "Formatting Check"
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Clang-Format Formatting
uses: jidicula/[email protected]
with:
check-path: llvm-plugin/cpp
- name: Rustfmt Formatting
run: |
cargo fmt --check --all
lint:
name: "Lint Check"
runs-on: ubuntu-latest
env:
LLVM_INSTALL_PATH: ~/llvm
LLVM_VERSION: "14"
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Setup LLVM Installation Path
run: |
mkdir ${{ env.LLVM_INSTALL_PATH }}
echo "$HOME/llvm/bin" >> $GITHUB_PATH
- name: Check LLVM Artifacts In Cache
id: cache-llvm
uses: actions/cache@v3
with:
path: |
${{ env.LLVM_INSTALL_PATH }}/bin/llvm-config
${{ env.LLVM_INSTALL_PATH }}/bin/opt
${{ env.LLVM_INSTALL_PATH }}/lib/libLLVM-${{ env.LLVM_VERSION }}.so
${{ env.LLVM_INSTALL_PATH }}/lib/libLLVM.so
${{ env.LLVM_INSTALL_PATH }}/include
key: ${{ runner.os }}-llvm-${{ env.LLVM_VERSION }}-opt
- name: LLVM Artifacts Missing
if: steps.cache-llvm.outputs.cache-hit != 'true'
run: false
- name: Clang-Tidy Lint
run: |
clang-tidy \
llvm-plugin/cpp/*.{cc,hh} \
--warnings-as-errors='*,-llvm-header-guard' \
-- -I"$HOME/llvm/include" -std=c++17 -DLLVM${{ env.LLVM_VERSION }}_0
- name: Clippy Lint
run: |
cargo clippy \
-p llvm-plugin \
--no-default-features \
--features target-x86,llvm${{ env.LLVM_VERSION }}-0 \
-- -D warnings