From 9471e28ad6f02bf2fae3782c3db68106b615595f Mon Sep 17 00:00:00 2001 From: Tom French <15848336+TomAFrench@users.noreply.github.com> Date: Wed, 15 Jan 2025 00:26:14 +0000 Subject: [PATCH] chore: add end step for formatting workflow (#7070) --- .github/workflows/formatting.yml | 26 +++++++++++++++++++ .../comptime_struct_definition/src/main.nr | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/.github/workflows/formatting.yml b/.github/workflows/formatting.yml index b132ba6f938..4e836ef2493 100644 --- a/.github/workflows/formatting.yml +++ b/.github/workflows/formatting.yml @@ -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') }} + diff --git a/test_programs/compile_success_empty/comptime_struct_definition/src/main.nr b/test_programs/compile_success_empty/comptime_struct_definition/src/main.nr index 75d48c6f1dd..0b71d44f016 100644 --- a/test_programs/compile_success_empty/comptime_struct_definition/src/main.nr +++ b/test_programs/compile_success_empty/comptime_struct_definition/src/main.nr @@ -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 });