mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
Merge pull request #20063 from RIOT-OS/merge_groups_migration
ci: migrate to github merge queues
This commit is contained in:
commit
7c57db8b6a
9
.github/workflows/check-commits.yml
vendored
9
.github/workflows/check-commits.yml
vendored
@ -2,6 +2,8 @@ name: check-commits
|
|||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [opened, reopened, synchronize]
|
types: [opened, reopened, synchronize]
|
||||||
|
merge_group:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check-commits:
|
check-commits:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -24,3 +26,10 @@ jobs:
|
|||||||
- name: Run checks
|
- name: Run checks
|
||||||
run: |
|
run: |
|
||||||
./dist/tools/${{ matrix.check }}/check.sh "${{ github.base_ref }}"
|
./dist/tools/${{ matrix.check }}/check.sh "${{ github.base_ref }}"
|
||||||
|
check-commits-success:
|
||||||
|
needs: check-commits
|
||||||
|
if: github.event_name != 'merge_group'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: check-commits succeeded
|
||||||
|
run: exit 0
|
||||||
|
3
.github/workflows/check-labels.yml
vendored
3
.github/workflows/check-labels.yml
vendored
@ -4,8 +4,11 @@ on:
|
|||||||
types: [opened, reopened, labeled, unlabeled, synchronize]
|
types: [opened, reopened, labeled, unlabeled, synchronize]
|
||||||
pull_request_review:
|
pull_request_review:
|
||||||
types: [submitted, dismissed]
|
types: [submitted, dismissed]
|
||||||
|
merge_group:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check-labels:
|
check-labels:
|
||||||
|
if: github.event_name != 'merge_group'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: RIOT-OS/check-labels-action@v1.1.1
|
- uses: RIOT-OS/check-labels-action@v1.1.1
|
||||||
|
2
.github/workflows/labeler.yml
vendored
2
.github/workflows/labeler.yml
vendored
@ -3,10 +3,12 @@ name: pr-labeler
|
|||||||
on:
|
on:
|
||||||
pull_request_target:
|
pull_request_target:
|
||||||
types: [opened, synchronize, reopened]
|
types: [opened, synchronize, reopened]
|
||||||
|
merge_group:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
triage:
|
triage:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
if: github.event_name != 'merge_group'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/labeler@main
|
- uses: actions/labeler@main
|
||||||
with:
|
with:
|
||||||
|
18
.github/workflows/static-test.yml
vendored
18
.github/workflows/static-test.yml
vendored
@ -13,6 +13,7 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- '*'
|
- '*'
|
||||||
|
merge_group:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
static-tests:
|
static-tests:
|
||||||
@ -21,11 +22,18 @@ jobs:
|
|||||||
- uses: actions/checkout@main
|
- uses: actions/checkout@main
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
- name: set CI_BASE_BRANCH
|
||||||
|
run: |
|
||||||
|
if [ -n "${{ github.base_ref }}" ]; then
|
||||||
|
echo "CI_BASE_BRANCH=${{ github.base_ref }}" >> $GITHUB_ENV
|
||||||
|
elif [ -n "${{ github.event.merge_group.base_ref }}" ]; then
|
||||||
|
echo "CI_BASE_BRANCH=${{ github.event.merge_group.base_ref }}" | sed s.=refs/heads/.=. >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
- name: Setup git
|
- name: Setup git
|
||||||
run: |
|
run: |
|
||||||
# Note: ${{ github.base_ref }} is empty when not in a PR
|
# Note: CI_BASE_BRANCH is empty when not in a PR
|
||||||
if [ -n "${{ github.base_ref }}" ]; then
|
if [ -n "${CI_BASE_BRANCH}" ]; then
|
||||||
git fetch origin ${{ github.base_ref }}:${{ github.base_ref }} --no-tags
|
git fetch origin ${CI_BASE_BRANCH}:${CI_BASE_BRANCH} --no-tags
|
||||||
else
|
else
|
||||||
git config diff.renameLimit 16384
|
git config diff.renameLimit 16384
|
||||||
fi
|
fi
|
||||||
@ -34,9 +42,9 @@ jobs:
|
|||||||
run: docker pull riot/static-test-tools:latest
|
run: docker pull riot/static-test-tools:latest
|
||||||
- name: Run static-tests
|
- name: Run static-tests
|
||||||
run: |
|
run: |
|
||||||
# Note: ${{ github.base_ref }} is empty when not in a PR
|
# Note: ${CI_BASE_BRANCH} is empty when not in a PR
|
||||||
docker run --rm \
|
docker run --rm \
|
||||||
-e CI_BASE_BRANCH=${{ github.base_ref }} \
|
-e CI_BASE_BRANCH \
|
||||||
-e GITHUB_RUN_ID=${GITHUB_RUN_ID} \
|
-e GITHUB_RUN_ID=${GITHUB_RUN_ID} \
|
||||||
-v $(pwd):/data/riotbuild \
|
-v $(pwd):/data/riotbuild \
|
||||||
riot/static-test-tools:latest \
|
riot/static-test-tools:latest \
|
||||||
|
1
.github/workflows/tools-buildtest.yml
vendored
1
.github/workflows/tools-buildtest.yml
vendored
@ -11,6 +11,7 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- '*'
|
- '*'
|
||||||
|
merge_group:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
tools-build:
|
tools-build:
|
||||||
|
2
.github/workflows/tools-test.yml
vendored
2
.github/workflows/tools-test.yml
vendored
@ -9,9 +9,11 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- '*'
|
- '*'
|
||||||
|
merge_group:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
python-tests:
|
python-tests:
|
||||||
|
if: github.event_name != 'merge_group'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@main
|
- uses: actions/checkout@main
|
||||||
|
36
.murdock
36
.murdock
@ -178,22 +178,18 @@ check_label() {
|
|||||||
return $?
|
return $?
|
||||||
}
|
}
|
||||||
|
|
||||||
# this function returns 0 when this is build is building one of the two bors
|
# true if "$2" starts with "$1", false otherwise
|
||||||
# branches ("staging" or "trying", 1 otherwise.
|
startswith() {
|
||||||
is_bors_build() {
|
case "${2}" in
|
||||||
test "${CI_BUILD_BRANCH}" = "staging" || test "${CI_BUILD_BRANCH}" = "trying"
|
${1}*) true ;;
|
||||||
|
*) false ;;
|
||||||
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
# Set CI_BASE_COMMIT in case of a bors build.
|
# this function returns 0 when this build is building a merge queue branch.
|
||||||
# This assumes that bors always adds a single merge commit (possibly itself
|
is_merge_queue_build() {
|
||||||
# including multiple merges for PRs) on the base branch.
|
startswith "gh-readonly-queue/" "${CI_BUILD_BRANCH}"
|
||||||
# That git command outputs the hash of the second merge commit (the one before
|
}
|
||||||
# the topmost merge), which should be the base branch HEAD.
|
|
||||||
# (CI_BASE_COMMIT is used by `can_fast_ci_run.py` to only build changes.)
|
|
||||||
if test -z "${CI_BASE_COMMIT}" && is_bors_build ; then
|
|
||||||
previous_merge="$(git log --merges --max-count 1 --skip 1 --pretty=format:%H)"
|
|
||||||
export CI_BASE_COMMIT="${previous_merge}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# fullbuild logic
|
# fullbuild logic
|
||||||
# non-full-builds are those where can_fast_ci_run might reduce the build
|
# non-full-builds are those where can_fast_ci_run might reduce the build
|
||||||
@ -216,8 +212,8 @@ fi
|
|||||||
# configurations.
|
# configurations.
|
||||||
if [ -z "${QUICK_BUILD}" ]; then
|
if [ -z "${QUICK_BUILD}" ]; then
|
||||||
export QUICK_BUILD=0
|
export QUICK_BUILD=0
|
||||||
if is_bors_build ; then
|
if is_merge_queue_build; then
|
||||||
# always do full build for bors' branches
|
# always do full build for merge queue' branches
|
||||||
true
|
true
|
||||||
elif [ ${FULL_BUILD} -eq 1 ]; then
|
elif [ ${FULL_BUILD} -eq 1 ]; then
|
||||||
# full build if building nightly or full build requested by label
|
# full build if building nightly or full build requested by label
|
||||||
@ -323,14 +319,6 @@ error() {
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
# true if "$2" starts with "$1", false otherwise
|
|
||||||
startswith() {
|
|
||||||
case "${2}" in
|
|
||||||
${1}*) true ;;
|
|
||||||
*) false ;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
# if MURDOCK_HOOK is set, this function will execute it and pass on all it's
|
# if MURDOCK_HOOK is set, this function will execute it and pass on all it's
|
||||||
# parameters. should the hook script exit with negative exit code, hook() makes
|
# parameters. should the hook script exit with negative exit code, hook() makes
|
||||||
# this script exit with error, too.
|
# this script exit with error, too.
|
||||||
|
Loading…
Reference in New Issue
Block a user