Unverified Commit 534d41ee authored by Wolfgang Walther's avatar Wolfgang Walther
Browse files

workflows/test: test merge-group workflow

Changes to the merge-group workflow should also validate that the file
is hooked up correctly and works - otherwise we risk merging CI changes
that cause the merge queue to fail consistently.
parent 06a0eba2
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -2,6 +2,17 @@ name: Merge Group

on:
  merge_group:
  workflow_call:
    inputs:
      mergedSha:
        required: true
        type: string
      targetSha:
        required: true
        type: string
    secrets:
      CACHIX_AUTH_TOKEN:
        required: true

permissions: {}

@@ -12,8 +23,8 @@ jobs:
    secrets:
      CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
    with:
      mergedSha: ${{ github.event.merge_group.head_sha }}
      targetSha: ${{ github.event.merge_group.base_sha }}
      mergedSha: ${{ inputs.mergedSha || github.event.merge_group.head_sha }}
      targetSha: ${{ inputs.targetSha || github.event.merge_group.base_sha }}

  # This job's only purpose is to serve as a target for the "Required Status Checks" branch ruleset.
  # It "needs" all the jobs that should block the Merge Queue.
+19 −0
Original line number Diff line number Diff line
@@ -13,9 +13,11 @@ jobs:
  prepare:
    runs-on: ubuntu-24.04-arm
    outputs:
      merge-group: ${{ steps.files.outputs.merge-group }}
      mergedSha: ${{ steps.prepare.outputs.mergedSha }}
      pr: ${{ steps.files.outputs.pr }}
      push: ${{ steps.files.outputs.push }}
      targetSha: ${{ steps.prepare.outputs.targetSha }}
    steps:
      - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
        with:
@@ -45,6 +47,12 @@ jobs:
              per_page: 100,
            })).map(file => file.filename)

            if (files.some(file => [
              '.github/workflows/lint.yml',
              '.github/workflows/merge-group.yml',
              '.github/workflows/test.yml',
            ].includes(file))) core.setOutput('merge-group', true)

            if (files.some(file => [
              '.github/actions/checkout/action.yml',
              '.github/workflows/build.yml',
@@ -63,6 +71,17 @@ jobs:
              '.github/workflows/test.yml',
            ].includes(file))) core.setOutput('push', true)

  merge-group:
    if: needs.prepare.outputs.merge-group
    name: Merge Group
    needs: [prepare]
    uses: ./.github/workflows/merge-group.yml
    secrets:
      CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
    with:
      mergedSha: ${{ needs.prepare.outputs.mergedSha }}
      targetSha: ${{ needs.prepare.outputs.targetSha }}

  pr:
    if: needs.prepare.outputs.pr
    name: PR