Skip to content

Commit b525392

Browse files
committed
ci: Rework modified files workflow
Signed-off-by: gsstoykov <georgi.stoykov@limechain.tech>
1 parent 708d4cb commit b525392

File tree

1 file changed

+15
-25
lines changed

1 file changed

+15
-25
lines changed

.github/workflows/zxc-build-library.yaml

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -36,31 +36,8 @@ permissions:
3636
contents: read
3737

3838
jobs:
39-
get-modified-files:
40-
name: Get Modified Files
41-
runs-on: ubuntu-latest
42-
steps:
43-
- name: Checkout Code
44-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
45-
with:
46-
submodules: true
47-
48-
- name: Get modified files
49-
id: modified-files
50-
run: |
51-
# Fetch the latest changes for main branch
52-
git fetch origin main
53-
54-
# Get the list of changed files between the current commit and the main branch
55-
files=$(git diff --name-only origin/main ${{ github.sha }} -- '*.cc' '*.h')
56-
57-
# Output the modified files
58-
echo "Modified files: $files"
59-
echo "::set-output name=modified_files::$files" # Set as output for passing to other jobs
60-
6139
build:
6240
name: Build
63-
needs: get-modified-files
6441
runs-on: hiero-client-sdk-linux-large
6542

6643
env:
@@ -123,12 +100,25 @@ jobs:
123100
with:
124101
submodules: true
125102

103+
- name: Get modified files
104+
id: modified-files
105+
run: |
106+
# Fetch the latest changes for main branch
107+
git fetch origin main
108+
109+
# Get the list of changed files between the current commit and the main branch
110+
files=$(git diff --name-only origin/main ${{ github.sha }} -- '*.cc' '*.h')
111+
112+
# Output the modified files
113+
echo "Modified files: $files"
114+
echo "::set-output name=modified_files::$files" # Set as output for passing to other jobs
115+
126116
- name: Run Clang-Format on Modified Files
127-
if: needs.get-modified-files.outputs.modified_files != ''
117+
if: steps.modified-files.outputs.modified_files != ''
128118
uses: jidicula/clang-format-action@c74383674bf5f7c69f60ce562019c1c94bc1421a # v4.13.0
129119
with:
130120
clang-format-version: "17"
131-
check-path: ${{ needs.get-modified-files.outputs.modified_files }} # Only run clang-format on modified files
121+
check-path: ${{ steps.modified-files.outputs.modified_files }} # Only run clang-format on modified files
132122

133123
- name: Use Node.js 22
134124
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0

0 commit comments

Comments
 (0)