From be822adec8e906d541bab5d4a05b0890912d4bab Mon Sep 17 00:00:00 2001 From: Johannes Marbach Date: Fri, 2 Oct 2026 13:33:29 +0200 Subject: [PATCH 1/4] Allow workflow_call on lint and test workflows --- .github/workflows/lint.yaml | 7 +++++++ .github/workflows/test.yaml | 28 +++++++++++++++++++++++++++- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index c2ba3b394..b0d0c50cc 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -1,6 +1,12 @@ name: Lint, format & type check on: pull_request: {} + workflow_call: + inputs: + matrix-js-sdk-sha: + type: string + required: false + description: The matrix-js-sdk commit to build against instead of the locked one jobs: lint: name: Lint, format & type check @@ -22,6 +28,7 @@ jobs: run: "scripts/layered.sh --ignore-pnpmfile" env: PR_HEAD_REPO_OWNER: ${{ github.event.pull_request.head.repo.owner.login }} + JS_SDK_GITHUB_BASE_REF: ${{ inputs.matrix-js-sdk-sha }} - name: Formatting run: "pnpm run format:check" - name: i18n diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index d29697e1d..1e11d09ea 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -3,6 +3,26 @@ on: pull_request: {} push: branches: [main] + # Lets matrix-js-sdk run these tests against one of its commits before merging it. + workflow_call: + inputs: + matrix-js-sdk-sha: + type: string + required: false + description: The matrix-js-sdk commit to build against instead of the locked one + disable_coverage: + type: boolean + required: false + default: false + description: Skip generating and uploading coverage + skip_e2e: + type: boolean + required: false + default: false + description: Skip the end-to-end tests + secrets: + CODECOV_TOKEN: + required: false jobs: vitest: name: Run unit tests @@ -24,6 +44,7 @@ jobs: run: "scripts/layered.sh --ignore-pnpmfile" env: PR_HEAD_REPO_OWNER: ${{ github.event.pull_request.head.repo.owner.login }} + JS_SDK_GITHUB_BASE_REF: ${{ inputs.matrix-js-sdk-sha }} - name: Get Playwright version run: echo "PLAYWRIGHT_VERSION=$(pnpm list @playwright/test --depth=0 --json | jq -r '.[0].devDependencies["@playwright/test"].version')" >> $GITHUB_ENV - name: Cache Playwright binaries @@ -37,8 +58,11 @@ jobs: if: steps.playwright-cache.outputs.cache-hit != 'true' run: pnpm playwright install --with-deps - name: Vitest - run: "pnpm run test:coverage" + run: pnpm vitest --coverage.enabled="$ENABLE_COVERAGE" + env: + ENABLE_COVERAGE: ${{ !inputs.disable_coverage }} - name: Upload to codecov + if: ${{ !inputs.disable_coverage }} uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7 env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} @@ -47,6 +71,7 @@ jobs: fail_ci_if_error: true playwright: name: Run end-to-end tests + if: ${{ !inputs.skip_e2e }} timeout-minutes: 60 runs-on: ubuntu-latest steps: @@ -64,6 +89,7 @@ jobs: run: scripts/layered.sh --ignore-pnpmfile env: PR_HEAD_REPO_OWNER: ${{ github.event.pull_request.head.repo.owner.login }} + JS_SDK_GITHUB_BASE_REF: ${{ inputs.matrix-js-sdk-sha }} - name: Get Playwright version run: echo "PLAYWRIGHT_VERSION=$(pnpm list @playwright/test --depth=0 --json | jq -r '.[0].devDependencies["@playwright/test"].version')" >> $GITHUB_ENV - name: Cache Playwright binaries From 6d70221fe6e29bce63e902e58f512d9004bcb72b Mon Sep 17 00:00:00 2001 From: Johannes Marbach Date: Mon, 5 Oct 2026 13:04:34 +0200 Subject: [PATCH 2/4] Flip boolean flags --- .github/workflows/test.yaml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 1e11d09ea..3a022a2b5 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -3,23 +3,22 @@ on: pull_request: {} push: branches: [main] - # Lets matrix-js-sdk run these tests against one of its commits before merging it. workflow_call: inputs: matrix-js-sdk-sha: type: string required: false description: The matrix-js-sdk commit to build against instead of the locked one - disable_coverage: + enable_coverage: type: boolean required: false - default: false - description: Skip generating and uploading coverage - skip_e2e: + default: true + description: Enable generating and uploading coverage reports + enable_e2e_tests: type: boolean required: false - default: false - description: Skip the end-to-end tests + default: true + description: Enable the end-to-end tests secrets: CODECOV_TOKEN: required: false @@ -60,9 +59,9 @@ jobs: - name: Vitest run: pnpm vitest --coverage.enabled="$ENABLE_COVERAGE" env: - ENABLE_COVERAGE: ${{ !inputs.disable_coverage }} + ENABLE_COVERAGE: ${{ inputs.enable_coverage }} - name: Upload to codecov - if: ${{ !inputs.disable_coverage }} + if: ${{ inputs.enable_coverage }} uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7 env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} @@ -71,7 +70,7 @@ jobs: fail_ci_if_error: true playwright: name: Run end-to-end tests - if: ${{ !inputs.skip_e2e }} + if: ${{ inputs.enable_e2e_tests }} timeout-minutes: 60 runs-on: ubuntu-latest steps: From 067f3d3038e85afe0a60a28800eb27e59cb89667 Mon Sep 17 00:00:00 2001 From: Johannes Marbach Date: Mon, 5 Oct 2026 13:44:48 +0200 Subject: [PATCH 3/4] Fix repo selection and flags --- .github/workflows/lint.yaml | 2 ++ .github/workflows/test.yaml | 10 +++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index b0d0c50cc..c59ba4024 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -15,6 +15,8 @@ jobs: - name: Checkout code uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 with: + # Inside a called workflow, github.repository is the caller so we need to make sure to still check out the EC repo here. + repository: ${{ inputs.matrix-js-sdk-sha && 'element-hq/element-call' || github.repository }} persist-credentials: false - name: Enable Corepack run: corepack enable diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 3a022a2b5..1ebe3529d 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -30,6 +30,8 @@ jobs: - name: Checkout code uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 with: + # Inside a called workflow, github.repository is the caller so we need to make sure to still check out the EC repo here. + repository: ${{ inputs.matrix-js-sdk-sha && 'element-hq/element-call' || github.repository }} persist-credentials: false - name: Enable Corepack run: corepack enable @@ -59,9 +61,9 @@ jobs: - name: Vitest run: pnpm vitest --coverage.enabled="$ENABLE_COVERAGE" env: - ENABLE_COVERAGE: ${{ inputs.enable_coverage }} + ENABLE_COVERAGE: ${{ inputs.enable_coverage != false }} - name: Upload to codecov - if: ${{ inputs.enable_coverage }} + if: ${{ inputs.enable_coverage != false }} uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7 env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} @@ -70,12 +72,14 @@ jobs: fail_ci_if_error: true playwright: name: Run end-to-end tests - if: ${{ inputs.enable_e2e_tests }} + if: ${{ inputs.enable_e2e_tests != false }} timeout-minutes: 60 runs-on: ubuntu-latest steps: - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 with: + # Inside a called workflow, github.repository is the caller so we need to make sure to still check out the EC repo here. + repository: ${{ inputs.matrix-js-sdk-sha && 'element-hq/element-call' || github.repository }} persist-credentials: false - name: Enable Corepack run: corepack enable From 6e5f71c796b8f6e7832957eef30eb9a77ee9dc21 Mon Sep 17 00:00:00 2001 From: Johannes Marbach Date: Mon, 5 Oct 2026 13:53:52 +0200 Subject: [PATCH 4/4] Revert back to negative flags --- .github/workflows/test.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 1ebe3529d..5e2703f67 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -9,16 +9,16 @@ on: type: string required: false description: The matrix-js-sdk commit to build against instead of the locked one - enable_coverage: + disable_coverage: type: boolean required: false - default: true - description: Enable generating and uploading coverage reports - enable_e2e_tests: + default: false + description: Skip generating and uploading coverage reports + disable_e2e_tests: type: boolean required: false - default: true - description: Enable the end-to-end tests + default: false + description: Skip the end-to-end tests secrets: CODECOV_TOKEN: required: false @@ -61,9 +61,9 @@ jobs: - name: Vitest run: pnpm vitest --coverage.enabled="$ENABLE_COVERAGE" env: - ENABLE_COVERAGE: ${{ inputs.enable_coverage != false }} + ENABLE_COVERAGE: ${{ !inputs.disable_coverage }} - name: Upload to codecov - if: ${{ inputs.enable_coverage != false }} + if: ${{ !inputs.disable_coverage }} uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7 env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} @@ -72,7 +72,7 @@ jobs: fail_ci_if_error: true playwright: name: Run end-to-end tests - if: ${{ inputs.enable_e2e_tests != false }} + if: ${{ !inputs.disable_e2e_tests }} timeout-minutes: 60 runs-on: ubuntu-latest steps: