This is an automated email from the ASF dual-hosted git repository.
dongjoon pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/orc.git
The following commit(s) were added to refs/heads/branch-2.0 by this push:
new dc85f1f8b ORC-1822: [C++][CI] Use cpp-linter-action for clang-tidy and
clang-format
dc85f1f8b is described below
commit dc85f1f8b52df374fe783d7a7d8e2efb82766851
Author: Gang Wu <[email protected]>
AuthorDate: Tue Apr 8 12:34:48 2025 +0900
ORC-1822: [C++][CI] Use cpp-linter-action for clang-tidy and clang-format
### What changes were proposed in this pull request?
Use the GitHub cpp-linter-action to report clang-tidy/clang-format issues
directly on the pull request.
### Why are the changes needed?
It is much easier to use and more user-friendly.
### How was this patch tested?
Pass CIs. I have also manually tested that it can report the issues.
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes #2184 from dongjoon-hyun/ORC-1822-2.0.
Authored-by: Gang Wu <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
---
.github/workflows/build_and_test.yml | 53 ++++++++++++++++++++++++++----------
1 file changed, 39 insertions(+), 14 deletions(-)
diff --git a/.github/workflows/build_and_test.yml
b/.github/workflows/build_and_test.yml
index fb38059e7..d429368ca 100644
--- a/.github/workflows/build_and_test.yml
+++ b/.github/workflows/build_and_test.yml
@@ -1,3 +1,20 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
name: Build and test
on:
@@ -157,21 +174,29 @@ jobs:
./mvnw install -DskipTests
./mvnw javadoc:javadoc
- formatting-check:
- name: "C++ format check"
- runs-on: ubuntu-20.04
- strategy:
- matrix:
- path:
- - 'c++'
- - 'tools'
+ cpp-linter:
+ runs-on: ubuntu-24.04
steps:
- - uses: actions/checkout@v3
- - name: Run clang-format style check for C++ code
- uses: jidicula/[email protected]
- with:
- clang-format-version: '13'
- check-path: ${{ matrix.path }}
+ - uses: actions/checkout@v4
+ - uses: cpp-linter/[email protected]
+ id: linter
+ continue-on-error: true
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ style: file
+ tidy-checks: file
+ files-changed-only: true
+ lines-changed-only: true
+ thread-comments: true
+ ignore: 'build|cmake_modules|conan|dev|docker|examples|java|site'
+ database: build/compile_commands.json
+ extra-args: #-Wno-unused-parameter
+ - name: Fail fast?!
+ if: steps.linter.outputs.checks-failed != 0
+ run: |
+ echo "some linter checks failed. ${{
steps.linter.outputs.checks-failed }}"
+ exit 1
license-check:
name: "License Check"