Skip to content

Commit af203bf

Browse files
committed
ci: Test clang-tidy plugin
The purpose of these tests is to ensure that anyone attempting to compile the clang-tidy plugin on the tested distributions will be able to and that the resulting plugin will work. Clang-tidy plugins were only introduced with Clang 16, so we can't test with any earlier versions than that. Signed-off-by: Mike Crowe <mac@mcrowe.com>
1 parent 949c3b5 commit af203bf

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Ubuntu
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
- master
8+
- release/*
9+
pull_request:
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
ci_test_clang_tidy:
17+
runs-on: ubuntu-latest
18+
strategy:
19+
matrix:
20+
# clang-tidy plugins require at least Clang 16. This means that
21+
# anything older than Ubuntu 24.04 and Debian 12 can't work at all.
22+
include:
23+
- distro: ubuntu:24.04
24+
clang_version: 16
25+
- distro: ubuntu:24.04
26+
clang_version: 17
27+
- distro: ubuntu:24.04
28+
clang_version: 18
29+
- distro: debian:12
30+
clang_version: 16
31+
- distro: debian:12
32+
clang_version: 19
33+
- distro: debian:trixie
34+
clang_version: 17
35+
- distro: debian:trixie
36+
clang_version: 18
37+
- distro: debian:trixie
38+
clang_version: 19
39+
container: ${{ matrix.distro }}
40+
steps:
41+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
42+
- name: List files
43+
run: ls -l
44+
- name: Install packages
45+
run: >-
46+
echo distro=${{matrix.distro}} &&
47+
echo clang_version=${{matrix.clang_version}} &&
48+
apt-get update &&
49+
apt-get install -y
50+
build-essential
51+
clang-${{ matrix.clang_version }}
52+
clang-tidy-${{ matrix.clang_version }}
53+
libclang-${{matrix.clang_version}}-dev
54+
cmake ninja-build
55+
- name: Run CMake
56+
run: cmake -S . -B build -G Ninja -DJSON_CI=On -DJSON_ClangTidyPlugin=ON
57+
- name: Build clang-tidy plugin
58+
run: cmake --build build --target clang_tidy_plugin/libNlohmannJsonClangTidyPlugin.so
59+
- name: Test clang-tidy plugin
60+
run: cd build && ctest -V --output-on-failure -R modernize-nlohmann-json-explicit-conversions-check

0 commit comments

Comments
 (0)