Skip to content

Commit 82f99ca

Browse files
author
Jan VL
committed
feat(release): add format and tidy checks before building packages
1 parent b97dd4a commit 82f99ca

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

.github/workflows/release.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,60 @@ permissions:
1010
contents: write
1111

1212
jobs:
13+
format-check:
14+
name: Check code formatting
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Install clang-format-18
21+
run: |
22+
sudo apt-get update
23+
sudo apt-get install -y clang-format-18
24+
25+
- name: Check C++ formatting
26+
run: ./scripts/format.sh --check
27+
28+
tidy-check:
29+
name: Run clang-tidy checks
30+
runs-on: ubuntu-latest
31+
container: fedora:42
32+
needs: [format-check]
33+
steps:
34+
- name: Checkout code
35+
uses: actions/checkout@v4
36+
37+
- name: Install dependencies
38+
run: |
39+
dnf install -y \
40+
gcc-c++ \
41+
clang \
42+
clang-tools-extra \
43+
cmake \
44+
ninja-build \
45+
git \
46+
protobuf-devel \
47+
abseil-cpp-devel \
48+
paho-c-devel \
49+
openssl-devel
50+
51+
- name: Configure CMake
52+
env:
53+
CC: clang
54+
CXX: clang++
55+
run: cmake --preset default
56+
57+
- name: Build (for compile_commands.json)
58+
run: cmake --build build -j$(nproc)
59+
60+
- name: Run clang-tidy
61+
run: ./scripts/tidy.sh --quiet
62+
1363
build-ubuntu-dynamic:
1464
name: Build Ubuntu 24.04 (dynamic)
1565
runs-on: ubuntu-24.04
66+
needs: [tidy-check]
1667
strategy:
1768
matrix:
1869
library: [c, cpp]
@@ -110,6 +161,7 @@ jobs:
110161
name: Build Alpine Linux (static musl)
111162
runs-on: ubuntu-latest
112163
container: alpine:latest
164+
needs: [tidy-check]
113165
steps:
114166
- name: Install build dependencies
115167
run: |
@@ -144,6 +196,7 @@ jobs:
144196
name: Build Fedora 42 (dynamic)
145197
runs-on: ubuntu-latest
146198
container: fedora:42
199+
needs: [tidy-check]
147200
strategy:
148201
matrix:
149202
library: [c, cpp]

0 commit comments

Comments
 (0)