From f6f28b8803a9be3ac1d87a0346c21644f0faecbf Mon Sep 17 00:00:00 2001 From: Roy Jeffrey Wignarajah Date: Tue, 27 Feb 2024 15:11:26 -0500 Subject: [PATCH 1/8] updated DoozyX/clang-format-lint to v0.17 --- .github/workflows/clang_format.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/clang_format.yml b/.github/workflows/clang_format.yml index c77eb2ba8..88f1979ae 100644 --- a/.github/workflows/clang_format.yml +++ b/.github/workflows/clang_format.yml @@ -25,7 +25,7 @@ jobs: # that's what will get formatted (i.e. the most recent commit) fetch-depth: 2 # format the latest commit - - uses: DoozyX/clang-format-lint-action@v0.16.2 + - uses: DoozyX/clang-format-lint-action@v0.17 with: source: "." exclude: "extern include" From 848f7bf2098d2e76233fc1fbf346d551d2fc7943 Mon Sep 17 00:00:00 2001 From: Roy Jeffrey Wignarajah Date: Tue, 27 Feb 2024 15:18:33 -0500 Subject: [PATCH 2/8] added tj-actions/changed-files step to list modified source files --- .github/workflows/clang_format.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/clang_format.yml b/.github/workflows/clang_format.yml index 88f1979ae..e9659f0ac 100644 --- a/.github/workflows/clang_format.yml +++ b/.github/workflows/clang_format.yml @@ -25,6 +25,13 @@ jobs: # that's what will get formatted (i.e. the most recent commit) fetch-depth: 2 # format the latest commit + - name: Changed Files + id: changed-files + uses: tj-actions/changed-files@v42.0.5 + with: + files: | + src/Features/*.cpp + src/Features/*.h - uses: DoozyX/clang-format-lint-action@v0.17 with: source: "." From 351734839d38b63eb8f4076756f81f158bf6707a Mon Sep 17 00:00:00 2001 From: Roy Jeffrey Wignarajah Date: Wed, 28 Feb 2024 21:37:36 -0500 Subject: [PATCH 3/8] updated changed-files job with shader files and separator --- .github/workflows/clang_format.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/clang_format.yml b/.github/workflows/clang_format.yml index e9659f0ac..4de8dff1b 100644 --- a/.github/workflows/clang_format.yml +++ b/.github/workflows/clang_format.yml @@ -32,6 +32,9 @@ jobs: files: | src/Features/*.cpp src/Features/*.h + **/*.hlsl + **/*.hlsli + separator: "," - uses: DoozyX/clang-format-lint-action@v0.17 with: source: "." From 6716236e896cb256ba7f2e1dce7d5d8ab9eb4307 Mon Sep 17 00:00:00 2001 From: Roy Jeffrey Wignarajah Date: Wed, 28 Feb 2024 21:39:57 -0500 Subject: [PATCH 4/8] updated changed-files step name, added process-list step --- .github/workflows/clang_format.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/clang_format.yml b/.github/workflows/clang_format.yml index 4de8dff1b..f16f39a99 100644 --- a/.github/workflows/clang_format.yml +++ b/.github/workflows/clang_format.yml @@ -25,7 +25,7 @@ jobs: # that's what will get formatted (i.e. the most recent commit) fetch-depth: 2 # format the latest commit - - name: Changed Files + - name: Retrieve changed files id: changed-files uses: tj-actions/changed-files@v42.0.5 with: @@ -35,6 +35,13 @@ jobs: **/*.hlsl **/*.hlsli separator: "," + - name: Process changed files list + id: process-list + run: | + CHANGED_FILES="${{ steps.changed-files.outputs.all_changed_files }}" + CHANGED_FILES="${CHANGED_FILES// /\\ }" + CHANGED_FILES=$(echo "$CHANGED_FILES" | tr ',' ' ') + echo "::set-output name=changed_files::${CHANGED_FILES}" - uses: DoozyX/clang-format-lint-action@v0.17 with: source: "." From 61dcc37641548cf6cea83e7cabed7cc4119607dc Mon Sep 17 00:00:00 2001 From: Roy Jeffrey Wignarajah Date: Wed, 28 Feb 2024 21:57:10 -0500 Subject: [PATCH 5/8] updated clang-format-lint action step to run only if there are modified source files --- .github/workflows/clang_format.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/clang_format.yml b/.github/workflows/clang_format.yml index f16f39a99..c1821ab45 100644 --- a/.github/workflows/clang_format.yml +++ b/.github/workflows/clang_format.yml @@ -42,7 +42,9 @@ jobs: CHANGED_FILES="${CHANGED_FILES// /\\ }" CHANGED_FILES=$(echo "$CHANGED_FILES" | tr ',' ' ') echo "::set-output name=changed_files::${CHANGED_FILES}" - - uses: DoozyX/clang-format-lint-action@v0.17 + - name: Format changed files + if: steps.changed-files.outputs.any_changed == 'true' + uses: DoozyX/clang-format-lint-action@v0.17 with: source: "." exclude: "extern include" From b3398f051afad50193287f042b0b1707ca8bdf46 Mon Sep 17 00:00:00 2001 From: Roy Jeffrey Wignarajah Date: Wed, 28 Feb 2024 22:12:16 -0500 Subject: [PATCH 6/8] modified format step to format only modified source files --- .github/workflows/clang_format.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/clang_format.yml b/.github/workflows/clang_format.yml index c1821ab45..7dc347881 100644 --- a/.github/workflows/clang_format.yml +++ b/.github/workflows/clang_format.yml @@ -46,7 +46,7 @@ jobs: if: steps.changed-files.outputs.any_changed == 'true' uses: DoozyX/clang-format-lint-action@v0.17 with: - source: "." + source: "${{ steps.process-list.outputs.changed_files }}" exclude: "extern include" extensions: "h,cpp,c,hlsl,hlsli" clangFormatVersion: 16 From bd37776b0ddd7879915853fb5b33309215a98e1e Mon Sep 17 00:00:00 2001 From: Roy Jeffrey Wignarajah Date: Wed, 28 Feb 2024 22:19:28 -0500 Subject: [PATCH 7/8] updated commments --- .github/workflows/clang_format.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/clang_format.yml b/.github/workflows/clang_format.yml index 7dc347881..fe18583d5 100644 --- a/.github/workflows/clang_format.yml +++ b/.github/workflows/clang_format.yml @@ -24,7 +24,7 @@ jobs: # make sure the parent commit is grabbed as well, because # that's what will get formatted (i.e. the most recent commit) fetch-depth: 2 - # format the latest commit + # retrieve comma-separated list of modified files - name: Retrieve changed files id: changed-files uses: tj-actions/changed-files@v42.0.5 @@ -35,6 +35,7 @@ jobs: **/*.hlsl **/*.hlsli separator: "," + # process modified files list before passing to clang-format-lint-action - name: Process changed files list id: process-list run: | @@ -42,6 +43,7 @@ jobs: CHANGED_FILES="${CHANGED_FILES// /\\ }" CHANGED_FILES=$(echo "$CHANGED_FILES" | tr ',' ' ') echo "::set-output name=changed_files::${CHANGED_FILES}" + # format the latest commit - name: Format changed files if: steps.changed-files.outputs.any_changed == 'true' uses: DoozyX/clang-format-lint-action@v0.17 From 9e1a4fff81c4ec40c26d3c8db0510c3c38637b0d Mon Sep 17 00:00:00 2001 From: Roy Jeffrey Wignarajah Date: Thu, 6 Jun 2024 20:48:39 -0400 Subject: [PATCH 8/8] updated changed-files globs to include all cpp (cpp/h) files under src folder and h/hpp files inside include folder --- .github/workflows/clang_format.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/clang_format.yml b/.github/workflows/clang_format.yml index fe18583d5..7395d9be8 100644 --- a/.github/workflows/clang_format.yml +++ b/.github/workflows/clang_format.yml @@ -30,8 +30,8 @@ jobs: uses: tj-actions/changed-files@v42.0.5 with: files: | - src/Features/*.cpp - src/Features/*.h + src/**/*.{cpp,h} + include/**/*.{h,hpp} **/*.hlsl **/*.hlsli separator: ","