Merge pull request #4401 from BowTiedDevOps/feat/check-jobs-success-with-composite

Check Multiple Tests' Success at Once
This commit is contained in:
wileyj
2024-02-28 13:39:03 -08:00
committed by GitHub
6 changed files with 101 additions and 0 deletions

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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