From 064366ef74f48558caa714a695967c65cdf09f32 Mon Sep 17 00:00:00 2001 From: Tom French Date: Fri, 25 Oct 2024 10:16:49 +0100 Subject: [PATCH] chore(ci): add end step to CI workflow --- .github/workflows/test.yml | 23 +++++++++++++++++++++++ src/lib.nr | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 971fc98..56df927 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -42,3 +42,26 @@ jobs: - name: Run formatter run: nargo fmt --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. + tests-end: + name: Noir End + runs-on: ubuntu-latest + # 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: + - test + - format + + steps: + - name: Report overall success + run: | + if [[ $FAIL == true ]]; then + exit 1 + else + exit 0 + fi + env: + # We treat any cancelled, 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/src/lib.nr b/src/lib.nr index f462129..2103dd8 100644 --- a/src/lib.nr +++ b/src/lib.nr @@ -100,8 +100,8 @@ where mod test { use crate::sort; - use crate::sort_via; use crate::sort_extended; + use crate::sort_via; fn sort_u32(a: u32, b: u32) -> bool { a <= b