|
36 | 36 | outputs:
|
37 | 37 | local_tests: ${{ steps.determine-test-type.outputs.local_tests }}
|
38 | 38 | remote_tests: ${{ steps.determine-test-type.outputs.remote_tests }}
|
| 39 | + pr_approval_state: ${{ steps.approval.outputs.approved }} |
39 | 40 | steps:
|
40 | 41 | - name: check-current-approval-status
|
41 | 42 | id: approval
|
@@ -144,7 +145,8 @@ jobs:
|
144 | 145 | image: ghcr.io/astral-sh/uv:debian
|
145 | 146 | options: --user 31001:61001 # Required slurm-batch UID: slurm GID for tmp/ file removal
|
146 | 147 | concurrency:
|
147 |
| - group: local-tests-${{ github.ref }} |
| 148 | + group: local-tests-${{ github.ref }}-${{ matrix.python-version }} |
| 149 | + cancel-in-progress: true # Required so it does not use previous state |
148 | 150 | strategy:
|
149 | 151 | matrix:
|
150 | 152 | python-version: ['3.9', '3.13']
|
@@ -324,26 +326,26 @@ jobs:
|
324 | 326 |
|
325 | 327 | pr-requirements-pass:
|
326 | 328 | name: pr-requirements-pass
|
327 |
| - if: ( needs.determine-test-scope.outputs.local_tests == 'true' ) || ( needs.determine-test-scope.outputs.remote_tests == 'true' ) |
| 329 | + if: always() && ( needs.determine-test-scope.outputs.local_tests == 'true' ) || ( needs.determine-test-scope.outputs.remote_tests == 'true' ) # always will run if dependent job is skipped |
328 | 330 | needs: [local-tests, remote-tests, lint]
|
329 | 331 | runs-on: ubuntu-latest
|
330 | 332 | steps:
|
331 | 333 | - name: check-passing-remote-tests
|
332 | 334 | run: |
|
333 | 335 | echo "Remote tests result: ${{ needs.remote-tests.result }}"
|
334 | 336 |
|
335 |
| - if [[ "${{ needs.lint.result }}" != "success" ]]; then |
| 337 | + if [[ "${{ needs.lint.result }}" != 'success' ]]; then |
336 | 338 | echo "❌ Linting failed or was skipped."
|
337 | 339 | exit 1
|
338 |
| - fi |
339 |
| -
|
340 |
| - if [[ "${{ needs.remote-tests.result }}" != "success" ]]; then |
| 340 | + elif [[ "${{ needs.remote-tests.result }}" != 'success' ]]; then |
341 | 341 | echo "❌ remote-tests failed or were skipped."
|
342 |
| - fi |
343 |
| -
|
344 |
| - if [[ "${{ needs.local-tests.result }}" != "success" ]]; then |
| 342 | + exit 1 # Given remote-tests always run after a PR is approved |
| 343 | + elif [[ "${{ needs.local-tests.result }}" != 'success' ]]; then |
345 | 344 | echo "❌ local-tests failed or were skipped."
|
346 | 345 | exit 1
|
| 346 | + elif [[ "${{ needs.determine-test-scope.outputs.pr_approval_state }}" == 'true' && github.event.pull_request ]]; then |
| 347 | + echo "❌ PR requires approval." |
| 348 | + exit 1 |
| 349 | + else |
| 350 | + echo "✅ All required test jobs passed!" |
347 | 351 | fi
|
348 |
| -
|
349 |
| - echo "✅ All required test jobs passed!" |
|
0 commit comments