-
Notifications
You must be signed in to change notification settings - Fork 1
65 lines (57 loc) · 1.66 KB
/
ci.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
name: ci
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
CodeFormatting:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Dependencies
run: |
sudo apt-get install clang-format-15
go install github.com/bazelbuild/buildtools/buildifier@latest
echo "PATH=$PATH:$(go env GOPATH)/bin/" >> $GITHUB_ENV
- name: Run formatting style check
run: |
scripts/run-format.sh
git diff > /tmp/format-diff
if [ -s "/tmp/format-diff" ]; then
echo "Difference to optimal formatting"
cat /tmp/format-diff
echo
echo "=================== To Fix ==========================="
echo "Run scripts/run-format.sh"
echo "then"
echo " git commit -a --amend"
echo " git push -f"
exit 1
fi
ClangTidy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get latest clang-tidy
run: |
apt -qq -y update
apt -qq -y install wget software-properties-common gpg lsb-release
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 15CF4D18AF4F7421
wget https://apt.llvm.org/llvm.sh
chmod +x ./llvm.sh
./llvm.sh 17
- name: Install Dependencies
run: |
sudo apt-get install clang-tidy-17 bazel
- name: Build Compilation DB
run: |
scripts/make-compilation-db.sh