Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a summary status of the CI build that we can block merges on. #18

Merged
merged 1 commit into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ env:
NO_VCR: "1"

jobs:
test:
ci-check:
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -66,3 +66,22 @@ jobs:
# We've found that there is a minor race condition where the shards aren't fully ready for the tests
# to hit them if we don't wait a bit after booting.
- run: script/ci_parts/${{ matrix.build_part }} ${{ matrix.datastore }} 10

# An extra job that runs after all the others and provides a single summary status.
# This is used by our branch protection rule to block merge until all CI checks passed,
# without requiring us to individually list each CI check in the branch protection rule.
#
# https://github.com/orgs/community/discussions/26822#discussioncomment-3305794
all-ci-checks-passed:
if: ${{ always() }} # so it runs even if the workflow was cancelled
runs-on: ubuntu-latest
name: All CI Checks Passed
needs: [ci-check]
steps:
- run: |
result="${{ needs.ci-check.result }}"
if [[ $result == "success" || $result == "skipped" ]]; then
exit 0
else
exit 1
fi
21 changes: 20 additions & 1 deletion script/update_ci_yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ env:
NO_VCR: "1"

jobs:
test:
ci-check:
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -148,3 +148,22 @@ jobs:
# We've found that there is a minor race condition where the shards aren't fully ready for the tests
# to hit them if we don't wait a bit after booting.
- run: script/ci_parts/${{ matrix.build_part }} ${{ matrix.datastore }} 10

# An extra job that runs after all the others and provides a single summary status.
# This is used by our branch protection rule to block merge until all CI checks passed,
# without requiring us to individually list each CI check in the branch protection rule.
#
# https://github.com/orgs/community/discussions/26822#discussioncomment-3305794
all-ci-checks-passed:
if: ${{ always() }} # so it runs even if the workflow was cancelled
runs-on: ubuntu-latest
name: All CI Checks Passed
needs: [ci-check]
steps:
- run: |
result="${{ needs.ci-check.result }}"
if [[ $result == "success" || $result == "skipped" ]]; then
exit 0
else
exit 1
fi