CI: Move Windows CI to a separate workflow

Having the pull_request 'labeled' event trigger the main CI is much too
impactful, since it cancels running jobs and does not start anything if
the label is anything else than 'windows'. Let's go with a different
approach and put the Windows CI job in a separate workflow.

How this works:

  * Jobs are only run if the 'windows' label is present on the PR.
  * If a PR is opened or updated, existing jobs are canceled.
  * If a PR is (un)labeled, existing jobs are only canceled if the label
    was 'windows'. Other labels cause the job to be rescheduled.

As far as I can see, there's no way to prevent the job from being
rescheduled when labels other than 'windows' are being added or removed.
However, by not canceling the existing Windows job, we can try to create
a cache so the next run will be much quicker.
This commit is contained in:
Jelle Raaijmakers 2025-06-22 11:40:12 +02:00 committed by Jelle Raaijmakers
commit 60ced8197e
Notes: github-actions[bot] 2025-06-22 10:48:34 +00:00
3 changed files with 34 additions and 32 deletions

32
.github/workflows/ci-windows.yml vendored Normal file
View file

@ -0,0 +1,32 @@
name: CI
on:
pull_request:
types:
- opened
- synchronize
- reopened
- labeled
- unlabeled
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
# Do not cancel in-progress runs if a labeling action took place (other than 'windows'). Otherwise, adding irrelevant
# labels causes existing runs to be canceled and a new (identical) run to be started.
cancel-in-progress: ${{ (github.event.action != 'labeled' && github.event.action != 'unlabeled') || github.event.label.name == 'windows' }}
jobs:
CI:
# Only run this job if the PR has the 'windows' label.
if: |
github.repository == 'LadybirdBrowser/ladybird'
&& contains(github.event.pull_request.labels.*.name, 'windows')
name: 'Windows, x86_64, Windows_SanitizerCI, ClangCL'
uses: ./.github/workflows/lagom-template.yml
with:
toolchain: 'ClangCL'
os_name: 'Windows'
runner_labels: '["windows-2025"]'
arch: 'x86_64'
build_preset: 'Windows_Sanitizer_CI'
clang_plugins: false

View file

@ -1,13 +1,6 @@
name: CI
on:
push:
pull_request:
types:
- opened
- synchronize
- reopened
- labeled
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || format('{0}-{1}', github.ref, github.run_number) }}
@ -16,12 +9,7 @@ concurrency:
jobs:
# CI matrix - runs the job in lagom-template.yml with different configurations.
Lagom:
# Run the items in this matrix only if:
# 1. The repository is the Ladybird repository; and
# 2. If the event was a push event, or a PR event other than 'labeled', or the label name is 'windows'
if: |
github.repository == 'LadybirdBrowser/ladybird'
&& (github.event_name != 'pull_request' || github.event.action != 'labeled' || github.event.label.name == 'windows')
if: github.repository == 'LadybirdBrowser/ladybird'
name: ${{ matrix.os_name }}, ${{ matrix.arch }}, ${{ matrix.build_preset }}, ${{ matrix.toolchain }}
strategy:
@ -33,7 +21,6 @@ jobs:
toolchain: ['GNU']
clang_plugins: [false]
runner_labels: ['["blacksmith-16vcpu-ubuntu-2404"]']
enabled: [true]
include:
- os_name: 'Linux'
@ -42,7 +29,6 @@ jobs:
toolchain: 'Clang'
clang_plugins: true
runner_labels: '["blacksmith-16vcpu-ubuntu-2404"]'
enabled: true
- os_name: 'macOS'
arch: 'arm64'
@ -50,7 +36,6 @@ jobs:
toolchain: 'Clang'
clang_plugins: false
runner_labels: '["macos-15", "self-hosted"]'
enabled: true
- os_name: 'Linux'
arch: 'x86_64'
@ -58,15 +43,6 @@ jobs:
toolchain: 'Clang'
clang_plugins: false
runner_labels: '["blacksmith-16vcpu-ubuntu-2404"]'
enabled: true
- os_name: 'Windows'
arch: 'x86_64'
build_preset: 'Windows_Sanitizer_CI'
toolchain: 'ClangCL'
clang_plugins: false
runner_labels: '["windows-2025"]'
enabled: ${{ contains(github.event.pull_request.labels.*.name, 'windows') }}
uses: ./.github/workflows/lagom-template.yml
with:
@ -76,4 +52,3 @@ jobs:
arch: ${{ matrix.arch }}
build_preset: ${{ matrix.build_preset }}
clang_plugins: ${{ matrix.clang_plugins }}
enabled: ${{ matrix.enabled }}

View file

@ -22,10 +22,6 @@ on:
required: false
type: boolean
default: false
enabled:
required: false
type: boolean
default: true
env:
# runner.workspace = /home/runner/work/ladybird
@ -42,7 +38,6 @@ env:
jobs:
CI:
if: ${{ inputs.enabled }}
runs-on: ${{ fromJSON(inputs.runner_labels) }}
steps: