diff --git a/.github/workflows/check-commits.yml b/.github/workflows/check-commits.yml index d294f3783648..c4d15bacf70a 100644 --- a/.github/workflows/check-commits.yml +++ b/.github/workflows/check-commits.yml @@ -2,6 +2,8 @@ name: check-commits on: pull_request: types: [opened, reopened, synchronize] + merge_group: + jobs: check-commits: runs-on: ubuntu-latest @@ -24,3 +26,10 @@ jobs: - name: Run checks run: | ./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 diff --git a/.github/workflows/check-labels.yml b/.github/workflows/check-labels.yml index 0639b4c97c5f..167ab44c583e 100644 --- a/.github/workflows/check-labels.yml +++ b/.github/workflows/check-labels.yml @@ -4,8 +4,11 @@ on: types: [opened, reopened, labeled, unlabeled, synchronize] pull_request_review: types: [submitted, dismissed] + merge_group: + jobs: check-labels: + if: github.event_name != 'merge_group' runs-on: ubuntu-latest steps: - uses: RIOT-OS/check-labels-action@v1.1.1 diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 052328779520..7b4efd24fd03 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -3,10 +3,12 @@ name: pr-labeler on: pull_request_target: types: [opened, synchronize, reopened] + merge_group: jobs: triage: runs-on: ubuntu-latest + if: github.event_name != 'merge_group' steps: - uses: actions/labeler@main with: diff --git a/.github/workflows/static-test.yml b/.github/workflows/static-test.yml index 81b2a517860e..65b4030df053 100644 --- a/.github/workflows/static-test.yml +++ b/.github/workflows/static-test.yml @@ -13,6 +13,7 @@ on: pull_request: branches: - '*' + merge_group: jobs: static-tests: @@ -21,11 +22,18 @@ jobs: - uses: actions/checkout@main with: 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 run: | - # Note: ${{ github.base_ref }} is empty when not in a PR - if [ -n "${{ github.base_ref }}" ]; then - git fetch origin ${{ github.base_ref }}:${{ github.base_ref }} --no-tags + # Note: CI_BASE_BRANCH is empty when not in a PR + if [ -n "${CI_BASE_BRANCH}" ]; then + git fetch origin ${CI_BASE_BRANCH}:${CI_BASE_BRANCH} --no-tags else git config diff.renameLimit 16384 fi @@ -34,9 +42,9 @@ jobs: run: docker pull riot/static-test-tools:latest - name: Run static-tests 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 \ - -e CI_BASE_BRANCH=${{ github.base_ref }} \ + -e CI_BASE_BRANCH \ -e GITHUB_RUN_ID=${GITHUB_RUN_ID} \ -v $(pwd):/data/riotbuild \ riot/static-test-tools:latest \ diff --git a/.github/workflows/tools-buildtest.yml b/.github/workflows/tools-buildtest.yml index 35bc9e8dded2..d16a3481a2d8 100644 --- a/.github/workflows/tools-buildtest.yml +++ b/.github/workflows/tools-buildtest.yml @@ -11,6 +11,7 @@ on: pull_request: branches: - '*' + merge_group: jobs: tools-build: diff --git a/.github/workflows/tools-test.yml b/.github/workflows/tools-test.yml index 8f6226de8136..5d5f4fe82c37 100644 --- a/.github/workflows/tools-test.yml +++ b/.github/workflows/tools-test.yml @@ -9,9 +9,11 @@ on: pull_request: branches: - '*' + merge_group: jobs: python-tests: + if: github.event_name != 'merge_group' runs-on: ubuntu-latest steps: - uses: actions/checkout@main diff --git a/.murdock b/.murdock index 321c1d150fba..b625b96ddc8c 100755 --- a/.murdock +++ b/.murdock @@ -178,22 +178,18 @@ check_label() { return $? } -# this function returns 0 when this is build is building one of the two bors -# branches ("staging" or "trying", 1 otherwise. -is_bors_build() { - test "${CI_BUILD_BRANCH}" = "staging" || test "${CI_BUILD_BRANCH}" = "trying" +# true if "$2" starts with "$1", false otherwise +startswith() { + case "${2}" in + ${1}*) true ;; + *) false ;; + esac } -# Set CI_BASE_COMMIT in case of a bors build. -# This assumes that bors always adds a single merge commit (possibly itself -# including multiple merges for PRs) on the base 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 +# this function returns 0 when this build is building a merge queue branch. +is_merge_queue_build() { + startswith "gh-readonly-queue/" "${CI_BUILD_BRANCH}" +} # fullbuild logic # non-full-builds are those where can_fast_ci_run might reduce the build @@ -216,8 +212,8 @@ fi # configurations. if [ -z "${QUICK_BUILD}" ]; then export QUICK_BUILD=0 - if is_bors_build ; then - # always do full build for bors' branches + if is_merge_queue_build; then + # always do full build for merge queue' branches true elif [ ${FULL_BUILD} -eq 1 ]; then # full build if building nightly or full build requested by label @@ -323,14 +319,6 @@ error() { 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 # parameters. should the hook script exit with negative exit code, hook() makes # this script exit with error, too.