Skip to content

Commit

Permalink
im losing my mind
Browse files Browse the repository at this point in the history
  • Loading branch information
S34NW committed Mar 11, 2024
1 parent b6e32bc commit d46a6b2
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 47 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,38 @@ jobs:
python-version: '3.8.2' # Script was made for 3.8.2
architecture: 'x86' # This MUST be x86
- run: python tools/ci/validate_rustg_windows.py

verify_merge:
# Below if lets it run as a required check but skip on normal push/PR events
if: ${{ github.event_name == 'merge_group' }}
name: Verify map merge sanity
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
# allegedly this is as deep as necessary to always receive the base ref
fetch-depth: 2

- name: Verify map merge
run: |
# assume we're at the head ref and give it a name we know
git switch -c gh/mergequeue/head
# go back to the base ref and attempt our own merge
git checkout ${{ github.event.merge_group.base_sha }}
git switch -c gh/mergequeue/base
git merge gh/mergequeue/head
# the merge was not concluded cleanly
if [ -e ".git/MERGE_HEAD" ]; then
echo "Merge state detected; manual resolution most likely required"
exit 1
fi
# if our merge was clean but our's and GitHubs differ, then complain
if [[ `git diff --exit-code gh/mergequeue/head` ]]; then
echo "Queue merge does not match driver merge; manual resolution most likely required"
exit 1
fi
47 changes: 0 additions & 47 deletions .github/workflows/merge_queue.yml
Original file line number Diff line number Diff line change
@@ -1,47 +0,0 @@
name: Merge Queue Tests
on:
push:
branches:
- master
- merge-queue-test
pull_request:
branches:
- master
- merge-queue-test
merge_group:

jobs:
verify_merge:
# Below if lets it run as a required check but skip on normal push/PR events
if: ${{ github.event_name == 'merge_group' }}
name: Verify map merge sanity
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
# allegedly this is as deep as necessary to always receive the base ref
fetch-depth: 2

- name: Verify map merge
run: |
# assume we're at the head ref and give it a name we know
git switch -c gh/mergequeue/head
# go back to the base ref and attempt our own merge
git checkout ${{ github.event.merge_group.base_sha }}
git switch -c gh/mergequeue/base
git merge gh/mergequeue/head
# the merge was not concluded cleanly
if [ -e ".git/MERGE_HEAD" ]; then
echo "Merge state detected; manual resolution most likely required"
exit 1
fi
# if our merge was clean but our's and GitHubs differ, then complain
if [[ `git diff --exit-code gh/mergequeue/head` ]]; then
echo "Queue merge does not match driver merge; manual resolution most likely required"
exit 1
fi

0 comments on commit d46a6b2

Please sign in to comment.