|
21 | 21 | contents: write # needed updating dependabot branches |
22 | 22 |
|
23 | 23 | lint: |
24 | | - needs: [ get-values ] |
| 24 | + needs: |
| 25 | + - get-values |
25 | 26 | name: Pre-commit |
26 | 27 | uses: ./.github/workflows/pre-commit.yaml |
27 | 28 | permissions: |
|
31 | 32 | python-version: {% endraw %}{{ python_version }}{% raw %} |
32 | 33 |
|
33 | 34 | test: |
34 | | - needs: [ lint ] |
| 35 | + needs: |
| 36 | + - lint |
35 | 37 | strategy: |
36 | 38 | matrix: |
37 | 39 | os: |
|
79 | 81 | slug: {% endraw %}{{ full_repo_url | replace("https://github.com/", "") }}{% raw %}{% endraw %}{% endif %}{% raw %} |
80 | 82 |
|
81 | 83 | {% endraw %}{% if is_frozen_executable %}{% raw %} executable: |
82 | | - needs: [ test ] |
| 84 | + needs: |
| 85 | + - test |
83 | 86 | strategy: |
84 | 87 | matrix: |
85 | 88 | os: |
@@ -117,7 +120,8 @@ jobs: |
117 | 120 |
|
118 | 121 | {% endraw %}{% if create_docs %}{% raw %} |
119 | 122 | build-docs: |
120 | | - needs: [ lint ] |
| 123 | + needs: |
| 124 | + - lint |
121 | 125 | strategy: |
122 | 126 | matrix: |
123 | 127 | python-version: |
@@ -152,17 +156,25 @@ jobs: |
152 | 156 | permissions: |
153 | 157 | statuses: write # needed for updating status on Dependabot PRs |
154 | 158 | needs: |
155 | | - - test |
156 | | - - get-values{% endraw %}{% if create_docs %} |
| 159 | + - get-values |
| 160 | + - test{% endraw %}{% if create_docs %} |
157 | 161 | - build-docs{% endif %}{% if is_frozen_executable %} |
158 | 162 | - executable{% endif %}{% raw %} |
159 | 163 | if: always() |
160 | 164 | timeout-minutes: {% endraw %}{{ gha_short_timeout_minutes }}{% raw %} |
161 | 165 | steps: |
162 | 166 | - name: fail if prior job failure |
163 | | - if: needs.test.result != 'success'{% endraw %}{% if create_docs %} || needs.build-docs.result != 'success'{% endif %}{% if is_frozen_executable %} || needs.executable.result != 'success'{% endif %}{% raw %} |
164 | 167 | run: | |
165 | | - exit 1 |
| 168 | + failure_pattern="^(failure|cancelled)$" |
| 169 | + |
| 170 | + if [[ "${{ needs.get-values.result }}" =~ $failure_pattern ]] ||{% endraw %}{% if create_docs %}{% raw %} |
| 171 | + [[ "${{ needs.build-docs.result }}" =~ $failure_pattern ]] ||{% endraw %}{% endif %}{% raw %}{% endraw %}{% if is_frozen_executable %}{% raw %} |
| 172 | + [[ "${{ needs.executable.result }}" =~ $failure_pattern ]] ||{% endraw %}{% endif %}{% raw %} |
| 173 | + [[ "${{ needs.test.result }}" =~ $failure_pattern ]]; then |
| 174 | + echo "❌ One or more jobs failed or were cancelled" |
| 175 | + exit 1 |
| 176 | + fi |
| 177 | + echo "✅ All jobs completed successfully or were skipped" |
166 | 178 | - name: Mark updated Dependabot commit of devcontainer hash as succeeded |
167 | 179 | if: needs.get-values.outputs.dependabot-commit-created == 'true' |
168 | 180 | env: |
|
0 commit comments