Skip to content

Commit 8ce7c2b

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". Both jobs now use 'if: always()' to ensure they run and report status regardless of dependency job outcomes. Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
1 parent acbf570 commit 8ce7c2b

File tree

2 files changed

+32
-14
lines changed

2 files changed

+32
-14
lines changed

.github/workflows/format_check.yml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@ on:
44
push:
55
branches:
66
- 'main'
7-
paths:
8-
- '**/*.c'
9-
- '**/*.cpp'
10-
- '**/*.h'
11-
- '**/*.hpp'
127

138
pull_request:
149
types:
@@ -18,11 +13,6 @@ on:
1813
- synchronize
1914
branches:
2015
- 'main'
21-
paths:
22-
- '**/*.c'
23-
- '**/*.cpp'
24-
- '**/*.h'
25-
- '**/*.hpp'
2616

2717
workflow_dispatch:
2818
inputs:
@@ -58,3 +48,19 @@ jobs:
5848
clang-format-version: '19'
5949
check-path: ${{ matrix.path['check'] }}
6050
exclude-regex: ${{ matrix.path['exclude'] }}
51+
52+
verify-format:
53+
name: verify-format
54+
runs-on: ubuntu-latest
55+
if: always()
56+
needs: format-check
57+
steps:
58+
- name: Check format results
59+
run: |
60+
if [[ "${{ needs.format-check.result }}" == "failure" ||
61+
"${{ needs.format-check.result }}" == "cancelled" ]]; then
62+
echo "Format check failed or was cancelled"
63+
exit 1
64+
else
65+
echo "Format check completed successfully"
66+
fi

.github/workflows/package_core.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ jobs:
3030
- name: Initialize Zephyr environment
3131
run: |
3232
yes | ./extra/bootstrap.sh -o=--filter=tree:0
33+
source venv/bin/activate
34+
echo "ZEPHYR_SDK_INSTALL_DIR=$(west config sdk.base-dir)" >> "$GITHUB_ENV"
3335
echo "CORE_TAG=$(git describe --tags --exact-match || git describe --always)" >> "$GITHUB_ENV"
3436
echo "CORE_ARTIFACT=ArduinoCore-zephyr-$(git describe --always)" >> "$GITHUB_ENV"
3537
echo "BOARD_VARIANTS=$(extra/get_board_details.sh | jq -cr 'sort_by(.variant)')" >> "$GITHUB_ENV"
@@ -42,6 +44,7 @@ jobs:
4244
- name: Build variants
4345
shell: bash
4446
run: |
47+
source venv/bin/activate
4548
./extra/build_all.sh -f
4649
4750
- name: Package core
@@ -184,15 +187,24 @@ jobs:
184187
failOnError: false
185188

186189
verify-core:
187-
name: Collect job errors
190+
name: verify-core
188191
runs-on: ubuntu-latest
189-
if: cancelled() || contains(needs.*.result, 'failure')
192+
if: always()
190193
needs:
191194
- package-core
192195
- test-core
193196
steps:
194-
- name: Notify failure
195-
run: exit 1
197+
- name: Check job results
198+
run: |
199+
if [[ "${{ needs.package-core.result }}" == "failure" ||
200+
"${{ needs.test-core.result }}" == "failure" ||
201+
"${{ needs.package-core.result }}" == "cancelled" ||
202+
"${{ needs.test-core.result }}" == "cancelled" ]]; then
203+
echo "One or more required jobs failed or were cancelled"
204+
exit 1
205+
else
206+
echo "All required jobs completed successfully"
207+
fi
196208
197209
publish-core:
198210
name: Publish core

0 commit comments

Comments
 (0)