test: always run aggregate unit test check (#34903)

When a shard of unit-tests.yml fails, we want the `success` job to be
maked "Failed" (not "Skipped"). That's because "Failed" blocks the PR
from merging, whereas "Skipped" does not. This change ensures that
`success` always runs to completion rather than being cancelled as soon
as a unit test shard fails or is cancelled.

From https://github.com/marketplace/actions/alls-green#options:

> Important: For this to work properly, it is a must to have the job always run,
> otherwise GitHub will make it skipped when any of the dependencies fail. In
> some contexts, skipped is interpreted as success which may lead to undersired,
> unobvious and even dangerous (as in security breach "dangerous") side-effects.

Closes https://github.com/openedx/edx-platform/issues/34789
This commit is contained in:
Kyle McCormick
2024-06-04 10:15:51 -04:00
committed by GitHub
parent 9caa2fa322
commit b063dfc1ea

View File

@@ -133,6 +133,7 @@ jobs:
success:
name: Unit tests successful
runs-on: ubuntu-20.04
if: always()
needs: [run-tests]
steps:
- name: Decide whether the needed jobs succeeded or failed