diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 9dd4794954..cc1ccd8666 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 eb095e41e2..e65419b4fe 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@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 diff --git a/.github/workflows/functional-test-cloud.yaml b/.github/workflows/functional-test-cloud.yaml index 8e958d5f45..2364e6e2d1 100644 --- a/.github/workflows/functional-test-cloud.yaml +++ b/.github/workflows/functional-test-cloud.yaml @@ -43,6 +43,7 @@ on: workflows: ["Approve Functional Tests"] types: - completed + merge_group: env: GOPROXY: https://proxy.golang.org @@ -95,7 +96,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" @@ -163,6 +165,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@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: @@ -569,7 +577,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 008fa6d993..03194a01f1 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 @@ -194,12 +199,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/lint.yaml b/.github/workflows/lint.yaml index 86fe257d6a..b174e54616 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 f61d3c30b1..10eb42c847 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 a9109f9e2e..bc56eb1611 100644 --- a/.github/workflows/publish-docs.yaml +++ b/.github/workflows/publish-docs.yaml @@ -21,6 +21,10 @@ on: pull_request: branches: - main + merge_group: + branches: + - main + jobs: changes: name: Changes 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 10bcb1dc5a..bb444f88d5 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 d5a05c6262..4eea5b014c 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@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 + - 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