-
Notifications
You must be signed in to change notification settings - Fork 475
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
Merge branch 'master' into merkle-perf
Showing
35 changed files
with
1,653 additions
and
192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,42 @@ | ||
name: Merge Checks | ||
|
||
on: | ||
pull_request: | ||
pull_request_target: | ||
branches: [ master ] | ||
types: [synchronize, opened, reopened, labeled, unlabeled] | ||
|
||
permissions: | ||
statuses: write | ||
|
||
jobs: | ||
design-approved-check: | ||
if: ${{ !contains(github.event.*.labels.*.name, 'design-approved') }} | ||
name: Design Approved Check | ||
check-design-approved: | ||
name: Check if Design Approved | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check for design-approved label | ||
- name: Check if design approved and update status | ||
run: | | ||
echo "Pull request is missing the 'design-approved' label" | ||
echo "This workflow fails so that the pull request cannot be merged" | ||
exit 1 | ||
set -x pipefail | ||
status_state="pending" | ||
if ${{ contains(github.event.pull_request.labels.*.name, 'design-approved') && !contains(github.event.pull_request.labels.*.name, 'after-next-version') }}; then | ||
status_state="success" | ||
else | ||
resp="$(curl -sSL --fail-with-body \ | ||
-H "Accept: application/vnd.github+json" \ | ||
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
"https://api.github.com/repos/$GITHUB_REPOSITORY/commits/${{ github.event.pull_request.head.sha }}/statuses")" | ||
if ! jq -e '.[] | select(.context == "Design Approved Check")' > /dev/null <<< "$resp"; then | ||
# Design not approved yet and no status exists | ||
# Keep it without a status to keep the green checkmark appearing | ||
# Otherwise, the commit and PR's CI will appear to be indefinitely pending | ||
# Merging will still be blocked until the required status appears | ||
exit 0 | ||
fi | ||
fi | ||
curl -sSL --fail-with-body \ | ||
-X POST \ | ||
-H "Accept: application/vnd.github+json" \ | ||
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
"https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/${{ github.event.pull_request.head.sha }}" \ | ||
-d '{"context":"Design Approved Check","state":"'"$status_state"'"}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
|
||
declare -Ar exceptions=( | ||
[contracts]=origin/develop | ||
[nitro-testnode]=origin/master | ||
|
||
#TODO Rachel to check these are the intended branches. | ||
[arbitrator/langs/c]=origin/vm-storage-cache | ||
[arbitrator/tools/wasmer]=origin/adopt-v4.2.8 | ||
) | ||
|
||
divergent=0 | ||
for mod in `git submodule --quiet foreach 'echo $name'`; do | ||
branch=origin/HEAD | ||
if [[ -v exceptions[$mod] ]]; then | ||
branch=${exceptions[$mod]} | ||
fi | ||
|
||
if ! git -C $mod merge-base --is-ancestor HEAD $branch; then | ||
echo $mod diverges from $branch | ||
divergent=1 | ||
fi | ||
done | ||
|
||
exit $divergent | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Submodule Pin Check | ||
|
||
on: | ||
pull_request: | ||
branches: [ master ] | ||
types: [synchronize, opened, reopened] | ||
|
||
jobs: | ||
submodule-pin-check: | ||
name: Submodule Pin Check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
submodules: recursive | ||
|
||
- name: Check all submodules are ancestors of origin/HEAD or configured branch | ||
run: ${{ github.workspace }}/.github/workflows/submodule-pin-check.sh | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.