mattermost-mobile-upstream/.github/workflows/ci.yml
yasserfaraazkhan 7396863217 fix(e2e): add MmBlocksTestHelper webhook-reachability methods + CI detox typecheck gate
mm_blocks_ephemeral.e2e.ts and mm_blocks_incoming_webhook.e2e.ts call
MmBlocksTestHelper.isWebhookSidecarReachable() / isWebhookSidecarReachableOrSkip(),
which were never defined (only requireWebhookServer existed). This produced 19
TS2339 errors, so those suites "failed to run", the E2E shard exited non-zero,
and its JUnit was dropped — silently reducing the reported Android test count.

- Add the two non-throwing reachability helpers (wrap requireWebhookServer).
- Add a detox-lint-typecheck job to ci.yml running `detox npm run tsc` on every
  PR. The detox/ package has its own tsconfig and was not covered by the root
  check, so a detox TS error could reach CI and silently drop a shard. Now it
  fails the PR check loudly instead.

detox `npm run tsc` exits 0.
2026-07-21 19:07:17 +05:30

80 lines
2.5 KiB
YAML

name: ci
on:
push:
branches:
- main
- 'release*'
pull_request:
permissions:
pull-requests: write
env:
NODE_VERSION: 24.15.0
TERM: xterm
jobs:
lint-typecheck:
runs-on: ubuntu-22.04
steps:
- name: ci/checkout-repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: ci/prepare-node-deps
uses: ./.github/actions/prepare-node-deps
- name: ci/check-styles
shell: bash
run: |
echo "::group::check-styles"
npm run check
echo "::endgroup::"
- name: ci/check-i18n
shell: bash
run: |
echo "::group::check-i18n"
./scripts/precommit/i18n.sh
echo "::endgroup::"
detox-lint-typecheck:
# Guard: the detox/ package has its own tsconfig and is NOT covered by the
# root check above. A TypeScript error in a detox test file makes its whole
# suite "fail to run", which makes that E2E CI shard exit non-zero and drop
# its JUnit — silently reducing the reported test count (mm_blocks TS2339
# incident). Type-check the detox package on every PR so it fails here,
# loudly, instead.
runs-on: ubuntu-22.04
steps:
- name: ci/checkout-repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: ci/prepare-node-deps
uses: ./.github/actions/prepare-node-deps
- name: ci/detox-install
shell: bash
# prepare-node-deps only installs the top-level node_modules; the detox
# package has its own, needed for its type-check.
run: cd detox && npm ci --prefer-offline --no-audit --no-fund
- name: ci/detox-typecheck
shell: bash
run: |
echo "::group::detox-typecheck"
cd detox && npm run tsc
echo "::endgroup::"
test:
runs-on: ubuntu-22.04
steps:
- name: ci/checkout-repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: ci/prepare-node-deps
uses: ./.github/actions/prepare-node-deps
- name: ci/run-tests
# main and PRs run test:coverage via the test-coverage action below;
# release branches just need a plain test pass.
if: startsWith(github.ref_name, 'release')
shell: bash
run: npm run test:ci
- name: ci/test-coverage
if: github.event_name == 'pull_request' || github.ref_name == 'main'
uses: ./.github/actions/test-coverage
with:
run_id: ${{ github.run_id }}