Skip to content

Commit 07e2b67

Browse files
committed
github: fix verify jobs to always report status
Fix verify-core and verify-format jobs that were causing GitHub PR status checks to get stuck with "Waiting for status to be reported". Remove the name for verify-core and ensure verify-format always reports a status. Signed-off-by: iabdalkader <[email protected]>
1 parent a26551e commit 07e2b67

File tree

2 files changed

+31
-13
lines changed

2 files changed

+31
-13
lines changed

.github/workflows/format_check.yml

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
name: 'Format Check'
2-
32
on:
43
push:
54
branches:
65
- 'main'
7-
paths:
8-
- '**/*.c'
9-
- '**/*.cpp'
10-
- '**/*.h'
11-
- '**/*.hpp'
126

137
pull_request:
148
types:
@@ -18,11 +12,6 @@ on:
1812
- synchronize
1913
branches:
2014
- 'main'
21-
paths:
22-
- '**/*.c'
23-
- '**/*.cpp'
24-
- '**/*.h'
25-
- '**/*.hpp'
2615

2716
workflow_dispatch:
2817
inputs:
@@ -32,7 +21,27 @@ on:
3221
default: 'warning'
3322

3423
jobs:
24+
check-changes:
25+
runs-on: ubuntu-latest
26+
outputs:
27+
should-check: ${{ steps.filter.outputs.src }}
28+
steps:
29+
# Only checkout for push events, not needed for PRs
30+
- uses: actions/checkout@v4
31+
if: github.event_name == 'push'
32+
- uses: dorny/paths-filter@v2
33+
id: filter
34+
with:
35+
filters: |
36+
src:
37+
- '**/*.c'
38+
- '**/*.cpp'
39+
- '**/*.h'
40+
- '**/*.hpp'
41+
3542
format-check:
43+
needs: check-changes
44+
if: needs.check-changes.outputs.should-check == 'true'
3645
runs-on: ubuntu-latest
3746
strategy:
3847
matrix:
@@ -51,10 +60,20 @@ jobs:
5160
with:
5261
submodules: false
5362
persist-credentials: false
54-
5563
- name: Run clang-format check
5664
uses: jidicula/[email protected]
5765
with:
5866
clang-format-version: '19'
5967
check-path: ${{ matrix.path['check'] }}
6068
exclude-regex: ${{ matrix.path['exclude'] }}
69+
70+
verify-format:
71+
if: always()
72+
needs: [check-changes, format-check]
73+
runs-on: ubuntu-latest
74+
steps:
75+
- name: Report Status
76+
run: |
77+
if [[ "${{ needs.format-check.result }}" == "failure" ]]; then
78+
exit 1
79+
fi

.github/workflows/package_core.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,6 @@ jobs:
184184
failOnError: false
185185

186186
verify-core:
187-
name: Collect job errors
188187
runs-on: ubuntu-latest
189188
if: cancelled() || contains(needs.*.result, 'failure')
190189
needs:

0 commit comments

Comments
 (0)