Skip to content

Commit 747c186

Browse files
[CI] Pin the clang-format version to 11 (#412)
### Motivation The `clang-format` tool on `ubuntu:22.04` runner was upgraded to 14 recently, whose rule is slightly different from 11. ### Modifications Use clang-format-action for code format check and specify the version to 11.
1 parent d0a3227 commit 747c186

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

.github/workflows/ci-pr-validation.yaml

+17-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,20 @@ concurrency:
2929

3030
jobs:
3131

32+
formatting-check:
33+
name: Formatting Check
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v3
37+
- name: Run clang-format style check for C/C++/Protobuf programs.
38+
uses: jidicula/[email protected]
39+
with:
40+
clang-format-version: '11'
41+
exclude-regex: '.*\.(proto|hpp)'
42+
3243
wireshark-dissector-build:
3344
name: Build the Wireshark dissector
45+
needs: formatting-check
3446
runs-on: ${{ matrix.os }}
3547
timeout-minutes: 60
3648
strategy:
@@ -61,6 +73,7 @@ jobs:
6173
6274
unit-tests:
6375
name: Run unit tests
76+
needs: formatting-check
6477
runs-on: ubuntu-22.04
6578
timeout-minutes: 120
6679

@@ -81,8 +94,8 @@ jobs:
8194
./vcpkg/vcpkg format-manifest vcpkg.json
8295
if [[ $(git diff | wc -l) -gt 0 ]]; then
8396
echo "Please run `./vcpkg/vcpkg format-manifest vcpkg.json` to reformat vcpkg.json"
97+
exit 1
8498
fi
85-
make check-format
8699
87100
- name: Build tests
88101
run: |
@@ -103,6 +116,7 @@ jobs:
103116
104117
cpp20-build:
105118
name: Build with the C++20 standard
119+
needs: formatting-check
106120
runs-on: ubuntu-22.04
107121
timeout-minutes: 60
108122

@@ -288,6 +302,7 @@ jobs:
288302
cpp-build-macos:
289303
timeout-minutes: 120
290304
name: Build CPP Client on macOS
305+
needs: formatting-check
291306
runs-on: macos-12
292307
steps:
293308
- name: checkout
@@ -337,7 +352,7 @@ jobs:
337352
check-completion:
338353
name: Check Completion
339354
runs-on: ubuntu-latest
340-
needs: [wireshark-dissector-build, unit-tests, cpp20-build, cpp-build-windows, package, cpp-build-macos]
355+
needs: [formatting-check, wireshark-dissector-build, unit-tests, cpp20-build, cpp-build-windows, package, cpp-build-macos]
341356

342357
steps:
343358
- run: true

0 commit comments

Comments
 (0)