Skip to content

Commit

Permalink
chore: add end step for formatting workflow (#7070)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAFrench authored Jan 15, 2025
1 parent 3b8d1da commit 9471e28
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
26 changes: 26 additions & 0 deletions .github/workflows/formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,29 @@ jobs:
- name: Format test suite
working-directory: ./test_programs
run: ./format.sh check

# This is a job which depends on all test jobs and reports the overall status.
# This allows us to add/remove test jobs without having to update the required workflows.
formatting-end:
name: Formatting End
runs-on: ubuntu-22.04
# We want this job to always run (even if the dependant jobs fail) as we want this job to fail rather than skipping.
if: ${{ always() }}
needs:
- clippy
- rustfmt
- eslint
- nargo_fmt

steps:
- name: Report overall success
run: |
if [[ $FAIL == true ]]; then
exit 1
else
exit 0
fi
env:
# We treat any skipped or failing jobs as a failure for the workflow as a whole.
FAIL: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') }}

Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ fn main() {

let (field1_name, field1_type) = fields[0];
let (field2_name, field2_type) = fields[1];

assert_eq(field1_name, quote { field1 });
assert_eq(field2_name, quote { field2 });

Expand Down

0 comments on commit 9471e28

Please sign in to comment.