ci: map runs-on to actual runner labels, trim jobs the runner can't serve

Root cause found for jobs never starting: runs were created all along
(visible in the Actions UI), but every job requested ubuntu-24.04 while
builder-1 only offers ubuntu-latest, linux-build and win-wine - a label
mismatch means jobs queue forever, invisible via the /actions/tasks API
which only lists picked-up jobs.

Mapped build/prepare/gate jobs to ubuntu-latest and the Linux desktop
build to linux-build (electronuserland/builder image, amd64/static only -
the only variant buildable on the single x86 runner). Removed jobs the
runner cannot serve instead of letting them starve the queue: web+desktop
playwright tests (need Docker-in-job and display setup, tracked as
follow-up in issue #2) and the native-Windows desktop build (workflow
assumes signtool/MSVC/PowerShell; the win-wine label awaits a dedicated
wine-based workflow).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Thore Cimbal
2026-07-30 12:00:00 +00:00
co-authored by Claude Sonnet 5
parent 8faade6c7b
commit 71ac7c4346
2 changed files with 29 additions and 207 deletions
+28 -206
View File
@@ -1,28 +1,35 @@
# builds Element Web # builds Element Web
# runs Playwright tests against the built Element Web # builds Element Desktop (Linux) using the built Element Web
# builds Element Desktop using the built Element Web
# #
# Tries to use a matching js-sdk branch for the build. # Tries to use a matching js-sdk branch for the build.
# #
# Produces a `webapp` artifact # Produces a `webapp` artifact
# Produces multiple Desktop artifacts # Produces Desktop artifacts
# Produces multiple Playwright report artifacts #
# Fork-Anpassungen (siehe docs/axion1337-fork.md):
# - runs-on-Labels auf die tatsaechlich registrierten Runner-Labels gemappt
# (builder-1 auf CFGMON: ubuntu-latest, linux-build, win-wine - KEIN
# ubuntu-24.04, kein macOS, kein natives Windows).
# - playwright_ew/downstream-modules entfernt: brauchen Docker-Zugriff im
# Job-Container (Testcontainers) und Browser-Setups, die der aktuelle
# Runner nicht bereitstellt - als Folgearbeit in Issue #2 nachgehalten.
# - build_ed_windows entfernt: build_desktop_windows.yaml ist fuer native
# Windows-Runner geschrieben (signtool-Pfade, MSVC-Targets, PowerShell).
# Das win-wine-Runner-Label existiert fuer eine kuenftige Wine-basierte
# Variante, die aber einen eigenen Workflow braucht.
# - build_ed_macos entfernt: kein macOS-Runner vorhanden.
name: Build & Test name: Build & Test
on: on:
# CRON to run all Projects at 6am UTC # CRON to run all Projects at 6am UTC
schedule: schedule:
- cron: "0 6 * * *" - cron: "0 6 * * *"
pull_request: {} pull_request: {}
merge_group:
types: [checks_requested]
push: push:
branches: [main] branches: [main]
# workflow_call entfernt: nichts in diesem Repo ruft build-and-test.yaml per # workflow_call entfernt: nichts in diesem Repo ruft build-and-test.yaml per
# workflow_call auf (verifiziert), und die Kombination push+workflow_call im # workflow_call auf (verifiziert), und die Kombination push+workflow_call im
# selben on:-Block triggert auf Gitea Actions 1.27 nicht zuverlaessig bei push # selben on:-Block triggert auf Gitea Actions 1.27 nicht zuverlaessig bei push
# (bekannter, als "not planned" geschlossener Gitea-Bug #33238). inputs.skip/ # (bekannter, als "not planned" geschlossener Gitea-Bug #33238).
# inputs.matrix-js-sdk-sha bleiben unten referenziert, werten fuer alle
# verbleibenden Trigger-Typen einfach zu null/leer aus (unveraendertes Verhalten).
concurrency: concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
@@ -31,8 +38,6 @@ concurrency:
env: env:
# fetchdep.sh needs to know our PR number # fetchdep.sh needs to know our PR number
PR_NUMBER: ${{ github.event.pull_request.number }} PR_NUMBER: ${{ github.event.pull_request.number }}
# Use 4 runners in the default case, but only 1 when running on a schedule where we run all 5 projects
NUM_RUNNERS: ${{ github.event_name == 'schedule' && 1 || 4 }}
NX_DEFAULT_OUTPUT_STYLE: stream-without-prefixes NX_DEFAULT_OUTPUT_STYLE: stream-without-prefixes
permissions: {} # No permissions required permissions: {} # No permissions required
@@ -40,13 +45,7 @@ permissions: {} # No permissions required
jobs: jobs:
build_ew: build_ew:
name: "Build Element Web" name: "Build Element Web"
runs-on: ubuntu-24.04 runs-on: ubuntu-latest
if: inputs.skip != true
outputs:
num-runners: ${{ env.NUM_RUNNERS }}
runners-matrix: ${{ steps.runner-vars.outputs.matrix }}
# Skip pull_request runs on renovate PRs to speed up CI time, delegating to the full run in merge queue
skip: ${{ inputs.skip || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'renovate/')) }}
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
@@ -61,9 +60,6 @@ jobs:
node-version: "lts/*" node-version: "lts/*"
- name: Fetch layered build - name: Fetch layered build
env:
# tell layered.sh to check out the right sha of the JS-SDK & EW, if they were given one
JS_SDK_GITHUB_BASE_REF: ${{ inputs.matrix-js-sdk-sha }}
run: scripts/layered.sh run: scripts/layered.sh
- name: Copy config - name: Copy config
@@ -83,212 +79,38 @@ jobs:
path: apps/web/webapp path: apps/web/webapp
retention-days: 1 retention-days: 1
- name: Calculate runner variables
id: runner-vars
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
with:
script: |
const numRunners = parseInt(process.env.NUM_RUNNERS, 10);
const matrix = Array.from({ length: numRunners }, (_, i) => i + 1);
core.setOutput("matrix", JSON.stringify(matrix));
playwright_ew:
name: "Run Tests [${{ matrix.project }}] ${{ matrix.runner }}/${{ needs.build_ew.outputs.num-runners }}"
needs: build_ew
if: needs.build_ew.outputs.skip == 'false'
runs-on: ubuntu-24.04
permissions:
actions: read
issues: read
pull-requests: read
strategy:
fail-fast: false
matrix:
# Run multiple instances in parallel to speed up the tests
runner: ${{ fromJSON(needs.build_ew.outputs.runners-matrix) }}
project:
- Chrome
- Firefox
- WebKit
- Dendrite
- Pinecone
runAllTests:
- ${{ github.event_name == 'schedule' || contains(github.event.pull_request.labels.*.name, 'X-Run-All-Tests') }}
# Skip the Firefox & Safari runs unless this was a cron trigger or PR has X-Run-All-Tests label
exclude:
- runAllTests: false
project: Firefox
- runAllTests: false
project: WebKit
- runAllTests: false
project: Dendrite
- runAllTests: false
project: Pinecone
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
repository: ${{ github.repository }}
- name: 📥 Download artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: webapp
path: apps/web/webapp
- uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
cache: "pnpm"
cache-dependency-path: pnpm-lock.yaml
node-version: "lts/*"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Setup playwright
uses: ./.github/actions/setup-playwright
with:
needs-webkit: ${{ matrix.project == 'WebKit' }}
write-cache: ${{ github.event_name != 'merge_group' }}
# We skip tests tagged with @mergequeue when running on PRs, but run them in MQ and everywhere else
- name: Run Playwright tests
working-directory: apps/web
run: |
pnpm test:playwright \
--shard "$SHARD" \
--project="${{ matrix.project }}" \
${{ (github.event_name == 'pull_request' && matrix.runAllTests == false ) && '--grep-invert @mergequeue' || '' }}
env:
SHARD: ${{ format('{0}/{1}', matrix.runner, needs.build_ew.outputs.num-runners) }}
- name: Upload blob report to GitHub Actions Artifacts
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: blob-report-${{ matrix.project }}-${{ matrix.runner }}
path: apps/web/blob-report
retention-days: 1
if-no-files-found: error
downstream-modules:
name: Downstream Playwright tests [element-modules]
needs: build_ew
if: needs.build_ew.outputs.skip == 'false' && github.event_name == 'merge_group'
uses: element-hq/element-modules/.github/workflows/reusable-playwright-tests.yml@main # zizmor: ignore[unpinned-uses]
with:
webapp-artifact: webapp
reporter: blob
prepare_ed: prepare_ed:
name: "Prepare Element Desktop" name: "Prepare Element Desktop"
uses: ./.github/workflows/build_desktop_prepare.yaml uses: ./.github/workflows/build_desktop_prepare.yaml
needs: build_ew needs: build_ew
if: needs.build_ew.outputs.skip == 'false'
permissions: permissions:
contents: read contents: read
with: with:
config: ${{ (github.event.pull_request.base.ref || github.ref_name) == 'develop' && 'element.io/nightly' || 'element.io/release' }} config: element.io/release
version: ${{ case((github.event.pull_request.base.ref || github.ref_name) == 'develop' || github.event_name == 'merge_group', 'develop', '') }}
webapp-artifact: webapp webapp-artifact: webapp
build_ed_windows:
needs: prepare_ed
name: "Desktop Windows"
uses: ./.github/workflows/build_desktop_windows.yaml
# Skip Windows builds on PRs, as the Linux amd64 build is enough of a smoke test and includes the screenshot tests
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'X-Run-All-Tests')
strategy:
matrix:
arch: [x64, ia32, arm64]
with:
arch: ${{ matrix.arch }}
blob_report: true
build_ed_linux: build_ed_linux:
needs: prepare_ed needs: prepare_ed
name: "Desktop Linux" name: "Desktop Linux"
uses: ./.github/workflows/build_desktop_linux.yaml uses: ./.github/workflows/build_desktop_linux.yaml
strategy:
matrix:
sqlcipher: [system, static]
arch: [amd64, arm64]
runAllTests:
- ${{ github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'X-Run-All-Tests') }}
exclude:
# We ship static sqlcipher builds, so delegate testing the system builds to the merge queue
- runAllTests: false
sqlcipher: system
# Additionally skip arm64 system builds on PRs, as the amd64 test is enough for a smoke test and includes the screenshot tests
- runAllTests: false
arch: arm64
with: with:
sqlcipher: ${{ matrix.sqlcipher }} # Wir shippen static-sqlcipher-amd64-Builds; arm64/system-Varianten
arch: ${{ matrix.arch }} # sind auf dem einzigen x86-Runner nicht sinnvoll baubar.
blob_report: true sqlcipher: static
arch: amd64
# build_ed_macos entfernt: der einzige Gitea-Actions-Runner (builder-1, CFGMON) hat runs-on: linux-build
# kein macOS-Label - der Job wuerde nie einen Runner finden statt sauber zu scheitern. # Desktop-Playwright-Tests brauchen Display-/Browser-Setup, das der
# Runner (noch) nicht bietet - gleiche Folgearbeit wie playwright_ew.
test: false
complete: complete:
name: end-to-end-tests name: build-complete
needs: needs:
- build_ew - build_ew
- playwright_ew
- downstream-modules
- prepare_ed - prepare_ed
- build_ed_windows
- build_ed_linux - build_ed_linux
if: always() if: always()
runs-on: ubuntu-24.04 runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
if: needs.build_ew.outputs.skip == 'false'
with:
persist-credentials: false
repository: ${{ github.repository }}
- uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5
if: needs.build_ew.outputs.skip == 'false'
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
if: needs.build_ew.outputs.skip == 'false'
with:
cache: "pnpm"
node-version: "lts/*"
- name: Install dependencies
if: needs.build_ew.outputs.skip == 'false'
run: pnpm install --frozen-lockfile
- name: Download blob reports from GitHub Actions Artifacts
if: needs.build_ew.outputs.skip == 'false'
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
pattern: blob-report-*
path: all-blob-reports
merge-multiple: true
- name: Merge into HTML Report
if: needs.build_ew.outputs.skip == 'false'
run: |
pnpm playwright merge-reports \
--config=playwright-merge.config.ts \
./all-blob-reports
env:
# Only pass creds to the flaky-reporter on main branch runs
GITHUB_TOKEN: ${{ github.ref_name == 'develop' && secrets.ELEMENT_BOT_TOKEN || '' }}
PLAYWRIGHT_HTML_TITLE: ${{ case(github.event_name == 'pull_request', format('Playwright Report PR-{0}', env.PR_NUMBER), 'Playwright Report') }}
# Upload the HTML report even if one of our reporters fails, this can happen when stale screenshots are detected
- name: Upload HTML report
if: always() && needs.build_ew.outputs.skip == 'false'
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: html-report
path: playwright-report
retention-days: 14
if-no-files-found: error
- if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') - if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: exit 1 run: exit 1
+1 -1
View File
@@ -47,7 +47,7 @@ jobs:
prepare: prepare:
name: Prepare name: Prepare
environment: ${{ inputs.nightly && 'packages.element.io' || '' }} environment: ${{ inputs.nightly && 'packages.element.io' || '' }}
runs-on: ubuntu-24.04 runs-on: ubuntu-latest # builder-1 hat kein ubuntu-24.04-Label
permissions: permissions:
contents: read contents: read
outputs: outputs: