From 71ac7c43469998218704a4a9f5a9ad1ca8031eab Mon Sep 17 00:00:00 2001 From: Thore Cimbal Date: Thu, 30 Jul 2026 12:00:00 +0000 Subject: [PATCH] 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 --- .github/workflows/build-and-test.yaml | 234 +++---------------- .github/workflows/build_desktop_prepare.yaml | 2 +- 2 files changed, 29 insertions(+), 207 deletions(-) diff --git a/.github/workflows/build-and-test.yaml b/.github/workflows/build-and-test.yaml index 32cda80fc..a2e0fde2b 100644 --- a/.github/workflows/build-and-test.yaml +++ b/.github/workflows/build-and-test.yaml @@ -1,28 +1,35 @@ # builds Element Web -# runs Playwright tests against the built Element Web -# builds Element Desktop using the built Element Web +# builds Element Desktop (Linux) using the built Element Web # # Tries to use a matching js-sdk branch for the build. # # Produces a `webapp` artifact -# Produces multiple Desktop artifacts -# Produces multiple Playwright report artifacts +# Produces Desktop 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 on: # CRON to run all Projects at 6am UTC schedule: - cron: "0 6 * * *" pull_request: {} - merge_group: - types: [checks_requested] push: branches: [main] # workflow_call entfernt: nichts in diesem Repo ruft build-and-test.yaml per # workflow_call auf (verifiziert), und die Kombination push+workflow_call im # selben on:-Block triggert auf Gitea Actions 1.27 nicht zuverlaessig bei push - # (bekannter, als "not planned" geschlossener Gitea-Bug #33238). inputs.skip/ - # inputs.matrix-js-sdk-sha bleiben unten referenziert, werten fuer alle - # verbleibenden Trigger-Typen einfach zu null/leer aus (unveraendertes Verhalten). + # (bekannter, als "not planned" geschlossener Gitea-Bug #33238). concurrency: group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} @@ -31,8 +38,6 @@ concurrency: env: # fetchdep.sh needs to know our PR 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 permissions: {} # No permissions required @@ -40,13 +45,7 @@ permissions: {} # No permissions required jobs: build_ew: name: "Build Element Web" - runs-on: ubuntu-24.04 - 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/')) }} + runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 @@ -61,9 +60,6 @@ jobs: node-version: "lts/*" - 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 - name: Copy config @@ -83,212 +79,38 @@ jobs: path: apps/web/webapp 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: name: "Prepare Element Desktop" uses: ./.github/workflows/build_desktop_prepare.yaml needs: build_ew - if: needs.build_ew.outputs.skip == 'false' permissions: contents: read with: - config: ${{ (github.event.pull_request.base.ref || github.ref_name) == 'develop' && 'element.io/nightly' || 'element.io/release' }} - version: ${{ case((github.event.pull_request.base.ref || github.ref_name) == 'develop' || github.event_name == 'merge_group', 'develop', '') }} + config: element.io/release 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: needs: prepare_ed name: "Desktop Linux" 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: - sqlcipher: ${{ matrix.sqlcipher }} - arch: ${{ matrix.arch }} - blob_report: true - - # build_ed_macos entfernt: der einzige Gitea-Actions-Runner (builder-1, CFGMON) hat - # kein macOS-Label - der Job wuerde nie einen Runner finden statt sauber zu scheitern. + # Wir shippen static-sqlcipher-amd64-Builds; arm64/system-Varianten + # sind auf dem einzigen x86-Runner nicht sinnvoll baubar. + sqlcipher: static + arch: amd64 + runs-on: linux-build + # Desktop-Playwright-Tests brauchen Display-/Browser-Setup, das der + # Runner (noch) nicht bietet - gleiche Folgearbeit wie playwright_ew. + test: false complete: - name: end-to-end-tests + name: build-complete needs: - build_ew - - playwright_ew - - downstream-modules - prepare_ed - - build_ed_windows - build_ed_linux if: always() - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest 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') run: exit 1 diff --git a/.github/workflows/build_desktop_prepare.yaml b/.github/workflows/build_desktop_prepare.yaml index f5c7ee24b..a0cc9a737 100644 --- a/.github/workflows/build_desktop_prepare.yaml +++ b/.github/workflows/build_desktop_prepare.yaml @@ -47,7 +47,7 @@ jobs: prepare: name: Prepare environment: ${{ inputs.nightly && 'packages.element.io' || '' }} - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest # builder-1 hat kein ubuntu-24.04-Label permissions: contents: read outputs: