Skip to content

Commit

Permalink
Merge pull request #18 from block/myron/ci-results
Browse files Browse the repository at this point in the history
Provide a summary status of the CI build that we can block merges on.
  • Loading branch information
myronmarston authored Nov 4, 2024
2 parents 80a37e9 + d5bd670 commit f9d58ce
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 2 deletions.
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

0 comments on commit f9d58ce

Please sign in to comment.