Skip to content

workflows/premerge: Cancel in progress jobs when a PR is merged (#125329) #125588

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 4, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions .github/workflows/premerge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,27 @@ permissions:

on:
pull_request:
types:
- opened
- synchronize
- reopened
# When a PR is closed, we still start this workflow, but then skip
# all the jobs, which makes it effectively a no-op. The reason to
# do this is that it allows us to take advantage of concurrency groups
# to cancel in progress CI jobs whenever the PR is closed.
- closed
paths:
- .github/workflows/premerge.yaml
push:
branches:
- 'main'
- 'release/**'

jobs:
premerge-checks-linux:
if: false && github.repository_owner == 'llvm'
if: >-
false && github.repository_owner == 'llvm' &&
(github.event_name != 'pull_request' || github.event.action != 'closed')
runs-on: llvm-premerge-linux-runners
concurrency:
group: ${{ github.workflow }}-linux-${{ github.event.pull_request.number || github.sha }}
Expand Down Expand Up @@ -71,7 +84,9 @@ jobs:
./.ci/monolithic-linux.sh "$(echo ${linux_projects} | tr ' ' ';')" "$(echo ${linux_check_targets})" "$(echo ${linux_runtimes} | tr ' ' ';')" "$(echo ${linux_runtime_check_targets})"

premerge-checks-windows:
if: false && github.repository_owner == 'llvm'
if: >-
false && github.repository_owner == 'llvm' &&
(github.event_name != 'pull_request' || github.event.action != 'closed')
runs-on: llvm-premerge-windows-runners
concurrency:
group: ${{ github.workflow }}-windows-${{ github.event.pull_request.number || github.sha }}
Expand Down Expand Up @@ -139,7 +154,8 @@ jobs:
if: >-
github.repository_owner == 'llvm' &&
(startswith(github.ref_name, 'release/') ||
startswith(github.base_ref, 'release/'))
startswith(github.base_ref, 'release/')) &&
(github.event_name != 'pull_request' || github.event.action != 'closed')
steps:
- name: Checkout LLVM
uses: actions/checkout@v4
Expand Down