Skip to content

Commit 09c49dd

Browse files
committed
simplify GHA required build settings
by adding a single `build-results` job which depends on all other jobs we can simplify the setting of required builds in the repository. currently, all builds - including all variations of the build matrix! - need to be manually specified. once this has been merged the settings can be changed to require only this one job (which will fail if any of the other jobs failed). this way it's also easier to add/remove jobs or change the build matrix as it no longer requires changing the settings on the repository. this is inspired by [this discussion on GH][discussion]. [discussion]: https://github.com/orgs/community/discussions/26822
1 parent 5856dca commit 09c49dd

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

.github/workflows/CI.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,17 @@ jobs:
8787
with:
8888
sarif_file: examples/stm32f4-event-printer/rust-clippy-results.sarif
8989
wait-for-processing: true
90+
91+
# simplify GH settings: have one single build to be required
92+
build-results:
93+
name: Final Results
94+
if: ${{ always() }}
95+
runs-on: ubuntu-latest
96+
needs: [lib, stm32f4-event-printer]
97+
steps:
98+
- name: check for failed builds of the library
99+
if: ${{ needs.lib.result != 'success' }}
100+
run: exit 1
101+
- name: check for failed builds of the example
102+
if: ${{ needs.stm32f4-event-printer.result != 'success' }}
103+
run: exit 1

0 commit comments

Comments
 (0)