Skip to content

Commit 8cb56ef

Browse files
committed
fixup! fixup! fixup! .github: Allow individual steps to fail
1 parent f2ff7b8 commit 8cb56ef

File tree

3 files changed

+31
-23
lines changed

3 files changed

+31
-23
lines changed

.github/workflows/build.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -119,32 +119,33 @@ jobs:
119119
source ci/build.sh
120120
assert_compiled
121121
122-
- name: Cancel steps
122+
- name: Assert state
123123
if: ${{ failure() }}
124124
run: |
125-
echo "::error ::ci: Cannot proceed without a compiled kernel, the workflow will be cancelled."
126-
"FATAL=true" >> "$GITHUB_ENV"
125+
source ci/build.sh
126+
set_step_fail "assert_state"
127+
"fatal=true" >> "$GITHUB_ENV"
127128
128129
- name: Sparse
129-
if: ${{ !cancelled() && env.FATAL != 'true' && env.CHECKS_SPARCE == 'true' }}
130+
if: ${{ !cancelled() && env.fatal != 'true' && env.CHECKS_SPARCE == 'true' }}
130131
run: |
131132
source ci/build.sh
132133
compile_kernel_sparse
133134
134135
- name: GCC fanalyzer
135-
if: ${{ !cancelled() && env.FATAL != 'true' && env.CHECKS_GCC_FANALYZER == 'true' }}
136+
if: ${{ !cancelled() && env.fatal != 'true' && env.CHECKS_GCC_FANALYZER == 'true' }}
136137
run: |
137138
source ci/build.sh
138139
compile_gcc_fanalyzer
139140
140141
- name: Clang analyzer
141-
if: ${{ !cancelled() && env.FATAL != 'true' && env.CHECKS_CLANG_ANALYZER == 'true' }}
142+
if: ${{ !cancelled() && env.fatal != 'true' && env.CHECKS_CLANG_ANALYZER == 'true' }}
142143
run: |
143144
source ci/build.sh
144145
compile_clang_analyzer
145146
146147
- name: Smatch
147-
if: ${{ !cancelled() && env.FATAL != 'true' && env.CHECKS_SMATCH == 'true' }}
148+
if: ${{ !cancelled() && env.fatal != 'true' && env.CHECKS_SMATCH == 'true' }}
148149
run: |
149150
source ci/build.sh
150151
compile_kernel_smatch
@@ -156,7 +157,7 @@ jobs:
156157
name: dist-${{ inputs.DEFCONFIG }}-${{ env.CID }}-${{ inputs.ARCH }}
157158
path: dist
158159

159-
- name: Assert
160+
- name: Export labels
160161
if: ${{ !cancelled() }}
161162
id: assert
162163
run: |

.github/workflows/checks.yml

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ on:
77
required: true
88
type: string
99
outputs:
10+
fatal:
11+
value: ${{ jobs.checks.outputs.fatal}}
1012
fail:
1113
value: ${{ jobs.checks.outputs.fail }}
1214
warn:
@@ -19,6 +21,7 @@ jobs:
1921
continue-on-error: true
2022

2123
outputs:
24+
fatal: ${{ steps.assert.outputs.fatal }}
2225
fail: ${{ steps.assert.outputs.fail }}
2326
warn: ${{ steps.assert.outputs.warn }}
2427

@@ -30,20 +33,21 @@ jobs:
3033
source ci/build.sh
3134
apply_prerun
3235
33-
- name: Cancel steps
36+
- name: Assert state
3437
if: ${{ failure() }}
35-
run: >
36-
echo "::error ::ci: Cannot proceed at this condition, the workflow will be cancelled."
37-
"FATAL=true" >> "$GITHUB_ENV"
38+
run: |
39+
source ci/build.sh
40+
set_step_fail "assert_state"
41+
"fatal=true" >> "$GITHUB_ENV"
3842
3943
- name: License
40-
if: ${{ !cancelled() && env.FATAL != 'true' }}
44+
if: ${{ !cancelled() && env.fatal != 'true' }}
4145
run: |
4246
source ci/build.sh
4347
check_license
4448
4549
- name: Check patch
46-
if: ${{ !cancelled() && env.FATAL != 'true' }}
50+
if: ${{ !cancelled() && env.fatal != 'true' }}
4751
run: |
4852
source ci/build.sh
4953
export -f check_checkpatch set_step_fail set_step_warn
@@ -52,7 +56,7 @@ jobs:
5256
exit $status
5357
5458
- name: Coccicheck
55-
if: ${{ !cancelled() && env.FATAL != 'true' }}
59+
if: ${{ !cancelled() && env.fatal != 'true' }}
5660
run: |
5761
source ci/build.sh
5862
export -f check_coccicheck set_step_fail set_step_warn
@@ -61,13 +65,13 @@ jobs:
6165
exit $status
6266
6367
- name: CPP Check
64-
if: ${{ !cancelled() && env.FATAL != 'true' }}
68+
if: ${{ !cancelled() && env.fatal != 'true' }}
6569
run: |
6670
source ci/build.sh
6771
check_cppcheck
6872
6973
- name: Checkout and patch reference branch
70-
if: ${{ !cancelled() && env.FATAL != 'true' && !startsWith(github.base_ref, 'mirror/') && !startsWith(github.ref_name, 'mirror/') }}
74+
if: ${{ !cancelled() && env.fatal != 'true' && !startsWith(github.base_ref, 'mirror/') && !startsWith(github.ref_name, 'mirror/') }}
7175
run: |
7276
git fetch origin --depth=1 "${{ inputs.ref_branch }}" &&
7377
git reset --hard origin/${{ inputs.ref_branch }} ||
@@ -103,20 +107,21 @@ jobs:
103107
done <<< "$files"
104108
105109
- name: Check dt-bindings
106-
if: ${{ !cancelled() && env.FATAL != 'true' }}
110+
if: ${{ !cancelled() && env.fatal != 'true' }}
107111
run: |
108112
source ci/build.sh
109113
check_dt_binding_check
110114
111115
- name: Revert patch reference branch
112-
if: ${{ !cancelled() && env.FATAL != 'true' && !startsWith(github.base_ref, 'mirror/') && !startsWith(github.ref_name, 'mirror/') }}
116+
if: ${{ !cancelled() && env.fatal != 'true' && !startsWith(github.base_ref, 'mirror/') && !startsWith(github.ref_name, 'mirror/') }}
113117
run: |
114118
git reset --hard $head_sha
115119
116-
- name: Assert checks
120+
- name: Export labels
117121
if: ${{ !cancelled() }}
118122
id: assert
119123
run: |
120-
echo "warn=$(printenv | grep ^step_warn_ | grep -v =$ | tr '\n' ',' | sed 's/,$//')" >> "$GITHUB_OUTPUT"
121-
echo "fail=$(printenv | grep ^step_fail_ | grep -v =$ | tr '\n' ',' | sed 's/,$//')" >> "$GITHUB_OUTPUT"
124+
echo "fatal=$fatal" >> "$GITHUB_OUTPUT"
125+
source ci/runner_env.sh
126+
export_labels
122127

.github/workflows/top-level.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
build_gcc_x86_64:
2828
uses: ./.github/workflows/build.yml
2929
needs: [checks]
30+
if: needs.checks.outputs.fatal != 'true'
3031
secrets: inherit
3132
with:
3233
CXX: "14"
@@ -35,6 +36,7 @@ jobs:
3536
build_llvm_x86_64:
3637
uses: ./.github/workflows/build.yml
3738
needs: [checks]
39+
if: needs.checks.outputs.fatal != 'true'
3840
secrets: inherit
3941
with:
4042
LLVM: "19"
@@ -44,6 +46,7 @@ jobs:
4446
build_gcc_aarch64:
4547
uses: ./.github/workflows/build.yml
4648
needs: [checks]
49+
if: needs.checks.outputs.fatal != 'true'
4750
secrets: inherit
4851
with:
4952
CXX: "14"
@@ -52,7 +55,6 @@ jobs:
5255
DEFCONFIG: "adi_ci_defconfig"
5356
build_gcc_arm:
5457
uses: ./.github/workflows/build.yml
55-
#needs: [checks]
5658
secrets: inherit
5759
with:
5860
CXX: "14"

0 commit comments

Comments
 (0)