mirror of
https://github.com/datahaven-xyz/datahaven
synced 2026-05-24 01:38:32 +00:00
ci: 👷 Add CI job to check rust tests results if they run (#16)
This PR adds a new job at the end of the `DataHave Operator Rust Tests` (`rust-tests.yml`) that checks: - If the tests were skipped (no changes in the `operator/` directory), it succeeds. - If the tests run and succeeded, it succeeds. - If the tests run and failed, it fails. This is useful to set this job as required in our merging ruleset, and account for cases where the tests are skipped.
This commit is contained in:
parent
d8d792874c
commit
4a955e504b
1 changed files with 22 additions and 0 deletions
22
.github/workflows/rust-tests.yml
vendored
22
.github/workflows/rust-tests.yml
vendored
|
|
@ -107,3 +107,25 @@ jobs:
|
|||
~/.cargo/bin/cargo-nextest nextest run \
|
||||
--archive-file ../nextest-archive.tar.zst \
|
||||
--partition count:${{ matrix.partition }}/2
|
||||
|
||||
tests-result-checker:
|
||||
name: Check tests were successful
|
||||
needs: [setup, all-rust-tests]
|
||||
if: always()
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Validate test results
|
||||
run: |
|
||||
echo "node_changed: ${{ needs.setup.outputs.node_changed }}"
|
||||
echo "matrix result: ${{ needs.all-rust-tests.result }}"
|
||||
|
||||
if [ "${{ needs.setup.outputs.node_changed }}" == "true" ]; then
|
||||
if [ "${{ needs.all-rust-tests.result }}" != "success" ]; then
|
||||
echo "Rust tests failed or were cancelled"
|
||||
exit 1
|
||||
else
|
||||
echo "Rust tests passed"
|
||||
fi
|
||||
else
|
||||
echo "No relevant changes — skipping rust tests"
|
||||
fi
|
||||
|
|
|
|||
Loading…
Reference in a new issue