From b806d7fb8b7075739bb2feeb9182f3f43ecc9493 Mon Sep 17 00:00:00 2001 From: rami3l Date: Fri, 5 Jan 2024 13:03:53 +0800 Subject: [PATCH 1/3] fix(ci): use `github.event_name == 'schedule'` instead of `github.event.schedule` --- .github/workflows/ci.yaml | 4 ++-- ci/actions-templates/linux-builds-template.yaml | 2 +- ci/actions-templates/windows-builds-template.yaml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8bacbb3dbf..e31fc96ebc 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -153,7 +153,7 @@ jobs: # Do not edit this file in .github/workflows build-windows-master: # job-name skip-pr skip-stable runs-on: windows-latest - if: ${{ (github.event_name == 'push' && github.ref_name == 'master') || github.event.schedule }} # skip-pr skip-stable + if: ${{ (github.event_name == 'push' && github.ref_name == 'master') || github.event_name == 'schedule' }} # skip-pr skip-stable env: RUSTFLAGS: -Ctarget-feature=+crt-static strategy: @@ -576,7 +576,7 @@ jobs: # Do not edit this file in .github/workflows build-linux-master: # job-name skip-pr skip-stable runs-on: ubuntu-latest - if: ${{ (github.event_name == 'push' && github.ref_name == 'master') || github.event.schedule }} # skip-pr skip-stable + if: ${{ (github.event_name == 'push' && github.ref_name == 'master') || github.event_name == 'schedule' }} # skip-pr skip-stable strategy: fail-fast: false matrix: diff --git a/ci/actions-templates/linux-builds-template.yaml b/ci/actions-templates/linux-builds-template.yaml index 6c6e083f56..3327122cf9 100644 --- a/ci/actions-templates/linux-builds-template.yaml +++ b/ci/actions-templates/linux-builds-template.yaml @@ -7,7 +7,7 @@ jobs: # skip-master skip-pr skip-stable build-linux-stable: # job-name skip-master skip-pr runs-on: ubuntu-latest if: ${{ github.event.pull_request }} # skip-master skip-stable - if: ${{ (github.event_name == 'push' && github.ref_name == 'master') || github.event.schedule }} # skip-pr skip-stable + if: ${{ (github.event_name == 'push' && github.ref_name == 'master') || github.event_name == 'schedule' }} # skip-pr skip-stable if: ${{ github.event_name == 'push' && github.ref_name == 'stable' }} # skip-pr skip-master strategy: fail-fast: false diff --git a/ci/actions-templates/windows-builds-template.yaml b/ci/actions-templates/windows-builds-template.yaml index 816d2886c1..7f6ff3a254 100644 --- a/ci/actions-templates/windows-builds-template.yaml +++ b/ci/actions-templates/windows-builds-template.yaml @@ -7,7 +7,7 @@ jobs: # skip-master skip-pr skip-stable build-windows-stable: # job-name skip-master skip-pr runs-on: windows-latest if: ${{ github.event.pull_request }} # skip-master skip-stable - if: ${{ (github.event_name == 'push' && github.ref_name == 'master') || github.event.schedule }} # skip-pr skip-stable + if: ${{ (github.event_name == 'push' && github.ref_name == 'master') || github.event_name == 'schedule' }} # skip-pr skip-stable if: ${{ github.event_name == 'push' && github.ref_name == 'stable' }} # skip-pr skip-master env: RUSTFLAGS: -Ctarget-feature=+crt-static From 07e28ac810e36ea40847f000f9e19e49356532f1 Mon Sep 17 00:00:00 2001 From: rami3l Date: Fri, 5 Jan 2024 13:13:15 +0800 Subject: [PATCH 2/3] feat(ci): enable the `merge_group` trigger --- .github/workflows/ci.yaml | 1 + ci/actions-templates/gen-workflows.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e31fc96ebc..e4f3b96d05 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -4,6 +4,7 @@ name: CI on: + merge_group: pull_request: branches: - "*" diff --git a/ci/actions-templates/gen-workflows.sh b/ci/actions-templates/gen-workflows.sh index abe8d1d385..4b06f882c4 100755 --- a/ci/actions-templates/gen-workflows.sh +++ b/ci/actions-templates/gen-workflows.sh @@ -14,6 +14,7 @@ cat << EOF > "$OUTPATH" name: CI on: + merge_group: pull_request: branches: - "*" From 2b5fc20b092fb1f86c6ccb1543d6004836b8a7ac Mon Sep 17 00:00:00 2001 From: rami3l Date: Fri, 5 Jan 2024 13:08:39 +0800 Subject: [PATCH 3/3] feat(ci): configure `merge_queue` to be a PR-like event --- .github/workflows/ci.yaml | 8 ++++---- ci/actions-templates/all-features-template.yaml | 2 +- ci/actions-templates/linux-builds-template.yaml | 2 +- ci/actions-templates/test-docs-template.yaml | 2 +- ci/actions-templates/windows-builds-template.yaml | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e4f3b96d05..18552233dd 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -22,7 +22,7 @@ jobs: # Do not edit this file in .github/workflows build-windows-pr: # job-name skip-master skip-stable runs-on: windows-latest - if: ${{ github.event.pull_request }} # skip-master skip-stable + if: ${{ contains('["pull_request", "merge_group"]', github.event_name) }} # skip-master skip-stable env: RUSTFLAGS: -Ctarget-feature=+crt-static strategy: @@ -433,7 +433,7 @@ jobs: # Do not edit this file in .github/workflows build-linux-pr: # job-name skip-master skip-stable runs-on: ubuntu-latest - if: ${{ github.event.pull_request }} # skip-master skip-stable + if: ${{ contains('["pull_request", "merge_group"]', github.event_name) }} # skip-master skip-stable strategy: fail-fast: false matrix: @@ -1143,7 +1143,7 @@ jobs: # templating and so on. build-all-features: # job-name runs-on: ubuntu-latest - if: ${{ github.event.pull_request }} + if: ${{ contains('["pull_request", "merge_group"]', github.event_name) }} strategy: fail-fast: false matrix: @@ -1182,7 +1182,7 @@ jobs: # stable is placed in the root of the gh-pages branch, while master is placed at /devel doc: # job-name runs-on: ubuntu-latest - if: ${{ github.event.pull_request }} + if: ${{ contains('["pull_request", "merge_group"]', github.event_name) }} steps: - uses: actions/checkout@v4 with: diff --git a/ci/actions-templates/all-features-template.yaml b/ci/actions-templates/all-features-template.yaml index 7e7bab0c21..3bfaa054f3 100644 --- a/ci/actions-templates/all-features-template.yaml +++ b/ci/actions-templates/all-features-template.yaml @@ -9,7 +9,7 @@ jobs: # skip-all # templating and so on. build-all-features: # job-name runs-on: ubuntu-latest - if: ${{ github.event.pull_request }} + if: ${{ contains('["pull_request", "merge_group"]', github.event_name) }} strategy: fail-fast: false matrix: diff --git a/ci/actions-templates/linux-builds-template.yaml b/ci/actions-templates/linux-builds-template.yaml index 3327122cf9..6e027e9e40 100644 --- a/ci/actions-templates/linux-builds-template.yaml +++ b/ci/actions-templates/linux-builds-template.yaml @@ -6,7 +6,7 @@ jobs: # skip-master skip-pr skip-stable build-linux-master: # job-name skip-pr skip-stable build-linux-stable: # job-name skip-master skip-pr runs-on: ubuntu-latest - if: ${{ github.event.pull_request }} # skip-master skip-stable + if: ${{ contains('["pull_request", "merge_group"]', github.event_name) }} # skip-master skip-stable if: ${{ (github.event_name == 'push' && github.ref_name == 'master') || github.event_name == 'schedule' }} # skip-pr skip-stable if: ${{ github.event_name == 'push' && github.ref_name == 'stable' }} # skip-pr skip-master strategy: diff --git a/ci/actions-templates/test-docs-template.yaml b/ci/actions-templates/test-docs-template.yaml index c17cd52193..ca5a899323 100644 --- a/ci/actions-templates/test-docs-template.yaml +++ b/ci/actions-templates/test-docs-template.yaml @@ -7,7 +7,7 @@ jobs: # skip-all # stable is placed in the root of the gh-pages branch, while master is placed at /devel doc: # job-name runs-on: ubuntu-latest - if: ${{ github.event.pull_request }} + if: ${{ contains('["pull_request", "merge_group"]', github.event_name) }} steps: - uses: actions/checkout@v4 with: diff --git a/ci/actions-templates/windows-builds-template.yaml b/ci/actions-templates/windows-builds-template.yaml index 7f6ff3a254..fa693dcc5e 100644 --- a/ci/actions-templates/windows-builds-template.yaml +++ b/ci/actions-templates/windows-builds-template.yaml @@ -6,7 +6,7 @@ jobs: # skip-master skip-pr skip-stable build-windows-master: # job-name skip-pr skip-stable build-windows-stable: # job-name skip-master skip-pr runs-on: windows-latest - if: ${{ github.event.pull_request }} # skip-master skip-stable + if: ${{ contains('["pull_request", "merge_group"]', github.event_name) }} # skip-master skip-stable if: ${{ (github.event_name == 'push' && github.ref_name == 'master') || github.event_name == 'schedule' }} # skip-pr skip-stable if: ${{ github.event_name == 'push' && github.ref_name == 'stable' }} # skip-pr skip-master env: