-
Notifications
You must be signed in to change notification settings - Fork 4
40 lines (32 loc) · 1.03 KB
/
check-formatting.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
name: Check formatting
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
check_formatting:
runs-on: ubuntu-20.04
name: Check formatting
steps:
- uses: actions/checkout@v4
- name: Setup Go environment
uses: actions/setup-go@v4
with:
go-version: '^1.23'
- name: Install formatters
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-get install software-properties-common
sudo add-apt-repository 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-13 main'
sudo apt-get install clang-format-13
go install github.com/google/addlicense@latest
go install github.com/bazelbuild/buildtools/buildifier@latest
- name: Run format.sh and print changes
run: |
./format.sh
clang-format --version
git diff
- name: Check for changes
run: "[ $(git status --porcelain | wc -l) -eq 0 ]"