diff --git a/.github/workflows/atlas-tests.yml b/.github/workflows/atlas-tests.yml index 8cb6b6bcc..1ea78e541 100644 --- a/.github/workflows/atlas-tests.yml +++ b/.github/workflows/atlas-tests.yml @@ -54,3 +54,17 @@ jobs: uses: stacks-network/actions/codecov@main with: test-name: ${{ matrix.test-name }} + + check-tests: + name: Check Tests + runs-on: ubuntu-latest + if: always() + needs: + - atlas-tests + steps: + - name: Check Tests Status + id: check_tests_status + uses: stacks-network/actions/check-jobs-status@main + with: + jobs: ${{ toJson(needs) }} + summary_print: "true" diff --git a/.github/workflows/bitcoin-tests.yml b/.github/workflows/bitcoin-tests.yml index babcbfda4..04359ff32 100644 --- a/.github/workflows/bitcoin-tests.yml +++ b/.github/workflows/bitcoin-tests.yml @@ -94,3 +94,17 @@ jobs: uses: stacks-network/actions/codecov@main with: test-name: ${{ matrix.test-name }} + + check-tests: + name: Check Tests + runs-on: ubuntu-latest + if: always() + needs: + - integration-tests + steps: + - name: Check Tests Status + id: check_tests_status + uses: stacks-network/actions/check-jobs-status@main + with: + jobs: ${{ toJson(needs) }} + summary_print: "true" diff --git a/.github/workflows/epoch-tests.yml b/.github/workflows/epoch-tests.yml index a50e0d344..be00618d5 100644 --- a/.github/workflows/epoch-tests.yml +++ b/.github/workflows/epoch-tests.yml @@ -78,3 +78,17 @@ jobs: uses: stacks-network/actions/codecov@main with: test-name: ${{ matrix.test-name }} + + check-tests: + name: Check Tests + runs-on: ubuntu-latest + if: always() + needs: + - epoch-tests + steps: + - name: Check Tests Status + id: check_tests_status + uses: stacks-network/actions/check-jobs-status@main + with: + jobs: ${{ toJson(needs) }} + summary_print: "true" diff --git a/.github/workflows/slow-tests.yml b/.github/workflows/slow-tests.yml index 0c2cb62ea..bce6a15a1 100644 --- a/.github/workflows/slow-tests.yml +++ b/.github/workflows/slow-tests.yml @@ -56,3 +56,17 @@ jobs: uses: stacks-network/actions/codecov@main with: test-name: ${{ matrix.test-name }} + + check-tests: + name: Check Tests + runs-on: ubuntu-latest + if: always() + needs: + - slow-tests + steps: + - name: Check Tests Status + id: check_tests_status + uses: stacks-network/actions/check-jobs-status@main + with: + jobs: ${{ toJson(needs) }} + summary_print: "true" diff --git a/.github/workflows/stacks-core-tests.yml b/.github/workflows/stacks-core-tests.yml index 1e883d3d9..1ba55f610 100644 --- a/.github/workflows/stacks-core-tests.yml +++ b/.github/workflows/stacks-core-tests.yml @@ -180,3 +180,19 @@ jobs: with: args: test --manifest-path=./contrib/core-contract-tests/Clarinet.toml contrib/core-contract-tests/tests/bns/name_register_test.ts + check-tests: + name: Check Tests + runs-on: ubuntu-latest + if: always() + needs: + - full-genesis + - unit-tests + - open-api-validation + - core-contracts-clarinet-test + steps: + - name: Check Tests Status + id: check_tests_status + uses: stacks-network/actions/check-jobs-status@main + with: + jobs: ${{ toJson(needs) }} + summary_print: "true" diff --git a/docs/ci-release.md b/docs/ci-release.md index ff0bca229..4e21ed631 100644 --- a/docs/ci-release.md +++ b/docs/ci-release.md @@ -135,6 +135,35 @@ ex: - `Stacks Blockchain Tests`: - `full-genesis`: Tests related to full genesis +### Checking the result of multiple tests at once + +You can use the [check-jobs-status](https://github.com/stacks-network/actions/tree/main/check-jobs-status) composite action in order to check that multiple tests are successful in 1 job. +If any of the tests given to the action (JSON string of `needs` field) fails, the step that calls the action will also fail. + +If you have to mark more than 1 job from the same workflow required in a ruleset, you can use this action in a separate job and only add that job as required. + +In the following example, `unit-tests` is a matrix job with 8 partitions (i.e. 8 jobs are running), while the others are normal jobs. +If any of the 11 jobs are failing, the `check-tests` job will also fail. + +```yaml +check-tests: + name: Check Tests + runs-on: ubuntu-latest + if: always() + needs: + - full-genesis + - unit-tests + - open-api-validation + - core-contracts-clarinet-test + steps: + - name: Check Tests Status + id: check_tests_status + uses: stacks-network/actions/check-jobs-status@main + with: + jobs: ${{ toJson(needs) }} + summary_print: "true" +``` + ## Triggering a workflow ### PR a branch to develop