From 5cf6701f6d0dcd8b0ef7a9141c5b8adfcaadbc66 Mon Sep 17 00:00:00 2001 From: Dariusz Porowski <3431813+DariuszPorowski@users.noreply.github.com> Date: Wed, 19 Nov 2025 17:38:20 -0800 Subject: [PATCH] ci(workflows): add merge_group event to various workflows Signed-off-by: Dariusz Porowski <3431813+DariuszPorowski@users.noreply.github.com> --- .github/workflows/build.yaml | 5 ++++ .../workflows/devcontainer-feature-test.yaml | 25 +++++++++++++++++ .github/workflows/functional-test-cloud.yaml | 13 +++++++-- .../workflows/functional-test-noncloud.yaml | 15 ++++++++--- .../workflows/functional-tests-approval.yaml | 1 + .github/workflows/lint.yaml | 4 +++ .github/workflows/nightly-rad-CLI-tests.yaml | 27 ++++++++++++++++++- .github/workflows/publish-docs.yaml | 4 +++ .github/workflows/require-pr-checklist.yaml | 6 ++++- .github/workflows/validate-bicep.yaml | 4 +++ .github/workflows/validate-installers.yaml | 15 ++++++++++- 11 files changed, 111 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 744f546d06..dae2989efa 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -32,6 +32,11 @@ on: - main - features/* - release/* + merge_group: + branches: + - main + - features/* + - release/* permissions: id-token: write # Required for requesting the JWT diff --git a/.github/workflows/devcontainer-feature-test.yaml b/.github/workflows/devcontainer-feature-test.yaml index ab49e45449..6e3f2edd31 100644 --- a/.github/workflows/devcontainer-feature-test.yaml +++ b/.github/workflows/devcontainer-feature-test.yaml @@ -13,10 +13,31 @@ on: - ".github/workflows/devcontainer-feature-test.yaml" branches: - main + merge_group: workflow_call: jobs: + changes: + if: github.event_name == 'merge_group' + runs-on: ubuntu-latest + outputs: + should_run: ${{ steps.changed-files.outputs.any_changed }} + steps: + - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@24d32ffd492484c1d75e0c0b894501ddb9d30d62 # v47 + with: + files: | + deploy/devcontainer-feature/** + .github/workflows/devcontainer-feature-test.yaml + test: + needs: changes + if: >- + github.event_name != 'merge_group' || + needs.changes.outputs.should_run == 'true' runs-on: ubuntu-latest strategy: matrix: @@ -34,6 +55,10 @@ jobs: working-directory: ./deploy/devcontainer-feature test-scenarios: + needs: changes + if: >- + github.event_name != 'merge_group' || + needs.changes.outputs.should_run == 'true' runs-on: ubuntu-latest steps: - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 diff --git a/.github/workflows/functional-test-cloud.yaml b/.github/workflows/functional-test-cloud.yaml index 68e8183ebb..e88965ce46 100644 --- a/.github/workflows/functional-test-cloud.yaml +++ b/.github/workflows/functional-test-cloud.yaml @@ -42,6 +42,7 @@ on: workflows: ["Approve Functional Tests"] types: - completed + merge_group: env: GOPROXY: https://proxy.golang.org @@ -94,7 +95,8 @@ jobs: if: github.event_name == 'repository_dispatch' || (github.event_name == 'schedule' && github.repository == 'radius-project/radius') || (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') || - github.event_name == 'workflow_dispatch' + github.event_name == 'workflow_dispatch' || + github.event_name == 'merge_group' env: DE_IMAGE: "ghcr.io/radius-project/deployment-engine" DE_TAG: "latest" @@ -166,6 +168,12 @@ jobs: echo "CHECKOUT_REPO=${{ github.repository }}" >> $GITHUB_ENV echo "CHECKOUT_REF=refs/heads/${{ github.event.inputs.branch }}" >> $GITHUB_ENV + - name: Set up checkout target (merge_group) + if: github.event_name == 'merge_group' + run: | + echo "CHECKOUT_REPO=${{ github.repository }}" >> $GITHUB_ENV + echo "CHECKOUT_REF=${{ github.ref }}" >> $GITHUB_ENV + - name: Check out code uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 with: @@ -462,7 +470,8 @@ jobs: if: github.event_name == 'repository_dispatch' || (github.event_name == 'schedule' && github.repository == 'radius-project/radius') || (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') || - github.event_name == 'workflow_dispatch' + github.event_name == 'workflow_dispatch' || + github.event_name == 'merge_group' strategy: fail-fast: true matrix: diff --git a/.github/workflows/functional-test-noncloud.yaml b/.github/workflows/functional-test-noncloud.yaml index 3279b4729b..8ac5ef097f 100644 --- a/.github/workflows/functional-test-noncloud.yaml +++ b/.github/workflows/functional-test-noncloud.yaml @@ -43,6 +43,11 @@ on: - main - features/* - release/* + merge_group: + branches: + - main + - features/* + - release/* env: # Helm version @@ -184,12 +189,16 @@ jobs: echo "CHECKOUT_REPO=${{ github.repository }}" >> $GITHUB_ENV echo "CHECKOUT_REF=refs/heads/main" >> $GITHUB_ENV - - name: Set up checkout target (pull_request) - if: github.event_name == 'pull_request' + - name: Set up checkout target (pull_request or merge_group) + if: github.event_name == 'pull_request' || github.event_name == 'merge_group' run: | echo "CHECKOUT_REPO=${{ github.repository }}" >> $GITHUB_ENV echo "CHECKOUT_REF=${{ github.ref }}" >> $GITHUB_ENV - echo "PR_NUMBER=${{ github.event.pull_request.number }}" >> $GITHUB_ENV + if [[ "${EVENT_NAME}" == "pull_request" ]]; then + echo "PR_NUMBER=${{ github.event.pull_request.number }}" >> $GITHUB_ENV + fi + env: + EVENT_NAME: ${{ github.event_name }} - name: Set up checkout target (workflow_dispatch) if: github.event_name == 'workflow_dispatch' diff --git a/.github/workflows/functional-tests-approval.yaml b/.github/workflows/functional-tests-approval.yaml index dd857886ba..79745013a7 100644 --- a/.github/workflows/functional-tests-approval.yaml +++ b/.github/workflows/functional-tests-approval.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=https://www.schemastore.org/github-workflow.json --- name: "Approve Functional Tests" + on: pull_request: branches: diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index ef391d55e4..22268db7cf 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -24,6 +24,10 @@ on: branches: - main - release/* + merge_group: + branches: + - main + - release/* concurrency: # Cancel the previously triggered build for only PR build. diff --git a/.github/workflows/nightly-rad-CLI-tests.yaml b/.github/workflows/nightly-rad-CLI-tests.yaml index 03f2a628e3..b32adf4f2e 100644 --- a/.github/workflows/nightly-rad-CLI-tests.yaml +++ b/.github/workflows/nightly-rad-CLI-tests.yaml @@ -11,11 +11,36 @@ on: types: [opened, synchronize, reopened] paths: - .github/workflows/nightly-rad-CLI-tests.yaml + merge_group: jobs: + changes: + runs-on: ubuntu-latest + if: >- + github.repository == 'radius-project/radius' && + github.event_name == 'merge_group' + outputs: + should_run: ${{ steps.changed-files.outputs.any_changed }} + steps: + - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@24d32ffd492484c1d75e0c0b894501ddb9d30d62 # v47 + with: + files: | + .github/workflows/nightly-rad-CLI-tests.yaml + download: + needs: changes runs-on: ubuntu-latest - if: github.repository == 'radius-project/radius' + if: >- + github.repository == 'radius-project/radius' && + ( + github.event_name == 'schedule' || + github.event_name == 'workflow_dispatch' || + github.event_name == 'pull_request' || + (github.event_name == 'merge_group' && needs.changes.outputs.should_run == 'true') + ) strategy: matrix: include: diff --git a/.github/workflows/publish-docs.yaml b/.github/workflows/publish-docs.yaml index dc6f2d23e6..a5eba1befc 100644 --- a/.github/workflows/publish-docs.yaml +++ b/.github/workflows/publish-docs.yaml @@ -20,6 +20,10 @@ on: pull_request: branches: - main + merge_group: + branches: + - main + jobs: reference-docs: name: Generate and PR reference documentation diff --git a/.github/workflows/require-pr-checklist.yaml b/.github/workflows/require-pr-checklist.yaml index a813eaa353..c2f8692685 100644 --- a/.github/workflows/require-pr-checklist.yaml +++ b/.github/workflows/require-pr-checklist.yaml @@ -5,12 +5,16 @@ name: Require PR Checklist on: pull_request: types: [opened, edited, synchronize] + merge_group: jobs: checklist-completed: - if: github.event.pull_request.user.login != 'dependabot[bot]' # Skip for Dependabot PRs + if: | + github.event_name == 'merge_group' || + github.event.pull_request.user.login != 'dependabot[bot]' runs-on: ubuntu-latest steps: - uses: mheap/require-checklist-action@46d2ca1a0f90144bd081fd13a80b1dc581759365 # v2.5.0 + if: github.event_name != 'merge_group' with: requireChecklist: true # If this is true and there are no checklists detected or not filled out, the action will fail diff --git a/.github/workflows/validate-bicep.yaml b/.github/workflows/validate-bicep.yaml index 7af971dc96..19f5126897 100644 --- a/.github/workflows/validate-bicep.yaml +++ b/.github/workflows/validate-bicep.yaml @@ -25,6 +25,10 @@ on: branches: - main - release/* + merge_group: + branches: + - main + - release/* permissions: id-token: write # Required for requesting the JWT diff --git a/.github/workflows/validate-installers.yaml b/.github/workflows/validate-installers.yaml index c3104f7ab6..fd18c190a3 100644 --- a/.github/workflows/validate-installers.yaml +++ b/.github/workflows/validate-installers.yaml @@ -17,10 +17,12 @@ # yaml-language-server: $schema=https://www.schemastore.org/github-workflow.json --- name: Validate Radius Installers + on: pull_request: paths: - "deploy/install.ps1" + merge_group: concurrency: # Cancel the previously triggered build for only PR build. @@ -34,6 +36,17 @@ jobs: steps: - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 + - name: Get changed files + id: changed-files + if: github.event_name == 'merge_group' + uses: tj-actions/changed-files@24d32ffd492484c1d75e0c0b894501ddb9d30d62 # v47 + with: + files: | + deploy/install.ps1 + - name: Run installer test script + if: >- + github.event_name != 'merge_group' || + steps.changed-files.outputs.any_changed == 'true' shell: powershell - run: "deploy/test-pwsh-install.ps1" + run: deploy/test-pwsh-install.ps1