Skip to content

Commit f78a699

Browse files
veloCopilot
andauthored
Add build status check job for branch protection (#295)
Signed-off-by: Marvin Froeder <marvin@datasqrl.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 8466416 commit f78a699

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,3 +216,28 @@ jobs:
216216
files: flink-sql-runner/target/flink-sql-runner-${{ needs.cache-dependencies.outputs.project-version }}-${{ needs.cache-dependencies.outputs.flink-version-label }}.jar
217217
env:
218218
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
219+
220+
build:
221+
runs-on: ubuntu-latest
222+
timeout-minutes: 10
223+
needs: [ unit-test, integration-test ]
224+
if: always()
225+
steps:
226+
- name: Check test results
227+
run: |
228+
echo "Checking results of upstream jobs..."
229+
FAILED_JOBS=""
230+
NEEDS_JSON='${{ toJSON(needs) }}'
231+
232+
for job in $(echo "$NEEDS_JSON" | jq -r 'keys[]'); do
233+
result=$(echo "$NEEDS_JSON" | jq -r ".[\"$job\"].result")
234+
echo " $job: $result"
235+
if [[ "$result" != "success" ]]; then
236+
FAILED_JOBS="$FAILED_JOBS $job"
237+
fi
238+
done
239+
240+
if [[ -n "$FAILED_JOBS" ]]; then
241+
echo "One or more jobs did not succeed:$FAILED_JOBS"
242+
exit 1
243+
fi

0 commit comments

Comments
 (0)