Skip to content

Commit 0788790

Browse files
authored
[tooling] Update tooling to match template (#67)
* Update CMake in accordance with new template * Add CI flag * Fix warnings * Add clang-tidy * update CMake version req * Change CI name * Fix tidy search directories * Fix compile error * Add clang-tidy to apt cache * Fix MacOS build? * Use clang-tidy-19 * Fix MacOS build? * kms * kms * Release and debug builds
1 parent 70caf55 commit 0788790

32 files changed

Lines changed: 475 additions & 476 deletions

.clang-tidy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Checks: 'clang-diagnostic-*,clang-analyzer-*,bugprone-*,modernize-*,performance-*,readability-*,concurrency-*,-modernize-use-trailing-return-type,-readability-else-after-return,-readability-math-missing-parentheses,-bugprone-easily-swappable-parameters,-readability-identifier-length,-readability-magic-numbers,-performance-implicit-conversion-in-loop,-bugprone-exception-escape'
2+
CheckOptions: [{key: readability-function-cognitive-complexity.Threshold, value: 35}]

.github/workflows/ci.yaml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,15 @@ on:
77
- main
88
workflow_dispatch:
99

10+
env:
11+
CI: true
12+
1013
jobs:
1114
ci:
1215
strategy:
1316
matrix:
14-
os: [ubuntu-22.04, ubuntu-22.04-arm, macos-latest, macos-14]
17+
os: [ubuntu-22.04, ubuntu-22.04-arm, macos-latest]
18+
build: [Release, Debug]
1519
fail-fast: false
1620
runs-on: ${{ matrix.os }}
1721
steps:
@@ -30,6 +34,10 @@ jobs:
3034
version: pcl-cache-v1
3135
execute_install_scripts: true
3236

37+
- name: Set up Homebrew (MacOS)
38+
if: ${{ contains(matrix.os, 'macos') }}
39+
uses: Homebrew/actions/setup-homebrew@master
40+
3341
- name: Cache Homebrew downloads (macOS)
3442
if: ${{ contains(matrix.os, 'macos') }}
3543
uses: actions/cache@v4
@@ -39,10 +47,6 @@ jobs:
3947
restore-keys: |
4048
homebrew-cache-${{ runner.os }}-
4149
42-
- name: Set up Homebrew (MacOS)
43-
if: ${{ contains(matrix.os, 'macos') }}
44-
uses: Homebrew/actions/setup-homebrew@master
45-
4650
- name: Brew update (MacOS)
4751
if: ${{ contains(matrix.os, 'macos') }}
4852
run: brew update
@@ -112,15 +116,16 @@ jobs:
112116
113117
# Build all (Cross-platform)
114118
- name: Build all
115-
run: make OPT=Release
119+
run: make OPT=${{ matrix.build }}
116120

117121
# Run tests (Cross-platform)
118122
- name: Run tests
119-
run: make test_ply OPT=Release
123+
run: make test_ply OPT=${{ matrix.build }}
120124

121125
# Run benchmarks (Cross-platform)
122126
- name: Run benchmarks
123-
run: make bench OPT=Release
127+
if: matrix.build == 'Release'
128+
run: make bench OPT=${{ matrix.build }}
124129

125130
# Test install (Cross-platform)
126131
- name: Test install

.github/workflows/lint.yaml

Lines changed: 76 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,86 @@
1-
name: Code Style
1+
name: Lint
22

33
on:
44
pull_request:
55
push:
66
branches:
77
- main
88

9-
jobs:
10-
build:
11-
runs-on: ubuntu-latest
9+
env:
10+
CI: true
1211

12+
jobs:
13+
lint:
14+
runs-on: ubuntu-22.04
1315
steps:
14-
- uses: actions/checkout@v2
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
1519
- uses: DoozyX/clang-format-lint-action@v0.18.1
20+
21+
- name: Add clang apt repository
22+
run: |
23+
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
24+
sudo add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main'
25+
26+
- name: apt update
27+
run: sudo apt-get update
28+
29+
- name: Cache APT packages (Ubuntu)
30+
uses: awalsh128/cache-apt-pkgs-action@latest
31+
with:
32+
packages: libpcl-dev libeigen3-dev libsdl2-dev mpich clang-tidy
33+
version: lint-cache-v1
34+
execute_install_scripts: true
35+
36+
# Install Eigen (Cross-platform)
37+
- name: Install Eigen
38+
run: |
39+
sudo apt-get install -y libeigen3-dev
40+
41+
# Install SDL2 (Cross-platform)
42+
- name: Install SDL2
43+
run: |
44+
sudo apt-get install -y libsdl2-dev
45+
46+
- name: Install PCL
47+
run: |
48+
sudo apt-get install mpich
49+
sudo apt-get install libpcl-dev
50+
51+
# Install sdl-wrapper (Cross-platform)
52+
- name: Install sdl-wrapper
53+
run: |
54+
git clone https://github.com/cornellev/sdl-wrapper.git
55+
cd sdl-wrapper
56+
sudo make install
57+
58+
# Install libcmdapp2 (Cross-platform)
59+
- name: Install libcmdapp2
60+
run: |
61+
git clone https://github.com/cornellev/libcmdapp2.git
62+
cd libcmdapp2
63+
sudo make install
64+
65+
# Install libconfig (Cross-platform)
66+
- name: Install libconfig
67+
run: |
68+
git clone https://github.com/cornellev/config
69+
cd config
70+
sudo make install
71+
72+
# Install simple-test (Cross-platform)
73+
- name: Install simple-test
74+
run: |
75+
git clone https://github.com/cornellev/simple-test
76+
cd simple-test
77+
sudo make install
78+
79+
- name: Install clang-tidy
80+
run: |
81+
sudo apt-get install clang-tidy-19
82+
sudo update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-19 100
83+
clang-tidy --version
84+
85+
- name: Run clang-tidy
86+
run: make tidy

0 commit comments

Comments
 (0)