forked from MapsHD/HDMapping
-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (31 loc) · 1.23 KB
/
check_code_formating.yml
File metadata and controls
41 lines (31 loc) · 1.23 KB
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
name: Clang-Format 21 Check
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
clang-format:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install clang-format 21 via LLVM APT repo
run: |
# Import LLVM GPG key properly
wget -qO - https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/llvm-snapshot.gpg > /dev/null
# Add LLVM repo for clang-format 21 (Debian bullseye repo works on Ubuntu 22.04)
echo "deb http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-21 main" | sudo tee /etc/apt/sources.list.d/llvm-21.list
# Update package lists
sudo apt-get update --allow-releaseinfo-change
# Install clang-format 21
sudo apt-get install -y clang-format-21
# Set clang-format 21 as default
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-21 210
sudo update-alternatives --set clang-format /usr/bin/clang-format-21
# Verify
clang-format --version
- name: Run clang-format check
run: python3 check_clang_format.py