You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by sz...@apache.org on 2025/07/15 14:03:10 UTC
(nifi-minifi-cpp) 03/04: MINIFICPP-2555 Use git diff to get the list of changed files
This is an automated email from the ASF dual-hosted git repository.
szaszm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git
commit 14b32d423508356f15a819306203a08ba125a721
Author: Ferenc Gerlits <fg...@gmail.com>
AuthorDate: Tue Jul 15 15:44:43 2025 +0200
MINIFICPP-2555 Use git diff to get the list of changed files
Getting rid of the Ana06/get-changed-files dependency.
Closes #1989
Signed-off-by: Marton Szasz <sz...@apache.org>
---
.github/workflows/ci.yml | 23 +++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index cee6ccfb9..7ccc4ccd4 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -328,25 +328,28 @@ jobs:
id: performance-test
run: ctest -j1 --verbose -L performance
working-directory: build
- - id: files
- uses: Ana06/get-changed-files@v2.3.0
- continue-on-error: true
- - name: clang-tidy
+ - name: list-changed-cpp-files
+ id: list-changed-cpp-files
run: |
- if [[ -n "${{ steps.files.outputs.all }}" ]]; then
- FILES="${{ steps.files.outputs.all }}"
+ head_commit=${{github.sha}}
+ if [[ -n "${{github.event.pull_request.base.sha}}" ]]; then
+ base_commit=${{github.event.pull_request.base.sha}}
+ git fetch --depth=1 origin ${base_commit}
else
- git fetch origin main && git checkout -b main origin/main || true
- FILES=$(git diff --name-only main ${{ github.sha }} --)
- git checkout ${{ github.sha }}
+ git fetch --depth=2 origin ${head_commit}
+ base_commit=$(git log -n2 --format=format:%H ${head_commit} | tail -n1)
fi
+ echo "Collecting added/copied/modified/renamed/type-changed .cpp files from ${base_commit} to ${head_commit}"
+ echo "files=$(git diff --name-only --diff-filter=ACMRT ${base_commit} ${head_commit} | grep '\.cpp$' | xargs)" >> $GITHUB_OUTPUT
+ - name: clang-tidy
+ run: |
# https://stackoverflow.com/questions/58466701/clang-tidy-cant-locate-stdlib-headers
sed -i -e 's/\/usr\/lib\/ccache\/clang++-16/\/lib\/llvm-16\/bin\/clang++/g' build/compile_commands.json
sed -i -e 's/\/usr\/lib\/ccache\/clang-16/\/lib\/llvm-16\/bin\/clang/g' build/compile_commands.json
sed -i -e 's/\/usr\/lib\/ccache\/c++/\/lib\/llvm-16\/bin\/clang++/g' build/compile_commands.json
sed -i -e 's/\/usr\/lib\/ccache\/cc/\/lib\/llvm-16\/bin\/clang/g' build/compile_commands.json
- parallel -j$(( $(nproc) + 1 )) ./run_clang_tidy.sh ::: ${FILES}
+ parallel -j$(( $(nproc) + 1 )) ./run_clang_tidy.sh ::: ${{steps.list-changed-cpp-files.outputs.files}}
- name: check-cores
if: ${{ failure() && steps.test.conclusion == 'failure' }}
run: |