mirror of
https://github.com/mattermost/mattermost-mobile.git
synced 2026-11-18 17:38:15 +00:00
194 lines
9.7 KiB
YAML
194 lines
9.7 KiB
YAML
# Detox E2E test runs — reusable workflow only.
|
|
# Called from e2e-detox-pr.yml after shared builds and server provisioning complete.
|
|
# App artifacts (ios-build-simulator-*, android-build-files-*) are uploaded by
|
|
# the parent workflow; templates download them via artifact_run_id.
|
|
name: Detox E2E
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
MOBILE_VERSION:
|
|
required: true
|
|
type: string
|
|
PLATFORM:
|
|
required: false
|
|
type: string
|
|
default: "both"
|
|
SITE_1_URL:
|
|
required: true
|
|
type: string
|
|
SITE_2_URL:
|
|
required: false
|
|
type: string
|
|
SITE_3_URL:
|
|
required: false
|
|
type: string
|
|
run_type:
|
|
required: false
|
|
type: string
|
|
default: "PR"
|
|
artifact_run_id:
|
|
description: "Run ID of the parent workflow that uploaded build artifacts"
|
|
required: true
|
|
type: string
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
env:
|
|
ARTIFACT_RUN_ID: ${{ inputs.artifact_run_id }}
|
|
|
|
jobs:
|
|
run-ios-tests:
|
|
if: inputs.PLATFORM == 'ios' || inputs.PLATFORM == 'both'
|
|
name: iOS
|
|
uses: ./.github/workflows/e2e-ios-template.yml
|
|
with:
|
|
run-type: ${{ inputs.run_type || 'PR' }}
|
|
record_tests_in_zephyr: ${{ inputs.run_type == 'RELEASE' || inputs.run_type == 'NIGHTLY' || inputs.run_type == 'MASTER' }}
|
|
MOBILE_VERSION: ${{ inputs.MOBILE_VERSION }}
|
|
MM_TEST_SERVER_URL: ${{ inputs.SITE_1_URL }}
|
|
MM_TEST_SERVER_URL_2: ${{ inputs.SITE_2_URL }}
|
|
MM_TEST_SERVER_URL_3: ${{ inputs.SITE_3_URL }}
|
|
artifact_run_id: ${{ inputs.artifact_run_id }}
|
|
secrets:
|
|
MM_MOBILE_E2E_ADMIN_EMAIL: ${{ secrets.MM_MOBILE_E2E_ADMIN_EMAIL }}
|
|
MM_MOBILE_E2E_ADMIN_USERNAME: ${{ secrets.MM_MOBILE_E2E_ADMIN_USERNAME }}
|
|
MM_MOBILE_E2E_ADMIN_PASSWORD: ${{ secrets.MM_MOBILE_E2E_ADMIN_PASSWORD }}
|
|
MM_MOBILE_E2E_ZEPHYR_API_KEY: ${{ secrets.MM_MOBILE_E2E_ZEPHYR_API_KEY }}
|
|
MM_MOBILE_E2E_TEST_CYCLE_LINK_PREFIX: ${{ secrets.MM_MOBILE_E2E_TEST_CYCLE_LINK_PREFIX }}
|
|
MM_MOBILE_E2E_WEBHOOK_URL: ${{ secrets.MM_MOBILE_E2E_WEBHOOK_URL }}
|
|
MM_MOBILE_DETOX_AWS_ACCESS_KEY_ID: ${{ secrets.MM_MOBILE_DETOX_AWS_ACCESS_KEY_ID }}
|
|
MM_MOBILE_DETOX_AWS_SECRET_ACCESS_KEY: ${{ secrets.MM_MOBILE_DETOX_AWS_SECRET_ACCESS_KEY }}
|
|
|
|
run-android-tests:
|
|
if: inputs.PLATFORM == 'android' || inputs.PLATFORM == 'both'
|
|
name: Android
|
|
uses: ./.github/workflows/e2e-android-template.yml
|
|
with:
|
|
run-android-tests: true
|
|
run-type: ${{ inputs.run_type || 'PR' }}
|
|
record_tests_in_zephyr: ${{ inputs.run_type == 'RELEASE' || inputs.run_type == 'NIGHTLY' || inputs.run_type == 'MASTER' }}
|
|
MOBILE_VERSION: ${{ inputs.MOBILE_VERSION }}
|
|
MM_TEST_SERVER_URL: ${{ inputs.SITE_1_URL }}
|
|
MM_TEST_SERVER_URL_2: ${{ inputs.SITE_2_URL }}
|
|
MM_TEST_SERVER_URL_3: ${{ inputs.SITE_3_URL }}
|
|
artifact_run_id: ${{ inputs.artifact_run_id }}
|
|
secrets:
|
|
MM_MOBILE_E2E_ADMIN_EMAIL: ${{ secrets.MM_MOBILE_E2E_ADMIN_EMAIL }}
|
|
MM_MOBILE_E2E_ADMIN_USERNAME: ${{ secrets.MM_MOBILE_E2E_ADMIN_USERNAME }}
|
|
MM_MOBILE_E2E_ADMIN_PASSWORD: ${{ secrets.MM_MOBILE_E2E_ADMIN_PASSWORD }}
|
|
MM_MOBILE_E2E_ZEPHYR_API_KEY: ${{ secrets.MM_MOBILE_E2E_ZEPHYR_API_KEY }}
|
|
MM_MOBILE_E2E_TEST_CYCLE_LINK_PREFIX: ${{ secrets.MM_MOBILE_E2E_TEST_CYCLE_LINK_PREFIX }}
|
|
MM_MOBILE_E2E_WEBHOOK_URL: ${{ secrets.MM_MOBILE_E2E_WEBHOOK_URL }}
|
|
MM_MOBILE_DETOX_AWS_ACCESS_KEY_ID: ${{ secrets.MM_MOBILE_DETOX_AWS_ACCESS_KEY_ID }}
|
|
MM_MOBILE_DETOX_AWS_SECRET_ACCESS_KEY: ${{ secrets.MM_MOBILE_DETOX_AWS_SECRET_ACCESS_KEY }}
|
|
|
|
run-ios-ipad-tests:
|
|
if: inputs.PLATFORM == 'ios' || inputs.PLATFORM == 'both'
|
|
name: iOS iPad
|
|
uses: ./.github/workflows/e2e-ios-template.yml
|
|
with:
|
|
run-type: ${{ inputs.run_type || 'PR' }}
|
|
MOBILE_VERSION: ${{ inputs.MOBILE_VERSION }}
|
|
MM_TEST_SERVER_URL: ${{ inputs.SITE_1_URL }}
|
|
ios_device_name: "iPad Pro 13-inch (M5)"
|
|
ios_device_os_name: "iOS 26.2"
|
|
search_path: "detox/e2e/test/products/channels/ipad"
|
|
parallelism: "1"
|
|
detox_config: "ios.ipad.debug"
|
|
artifact_run_id: ${{ inputs.artifact_run_id }}
|
|
secrets:
|
|
MM_MOBILE_E2E_ADMIN_EMAIL: ${{ secrets.MM_MOBILE_E2E_ADMIN_EMAIL }}
|
|
MM_MOBILE_E2E_ADMIN_USERNAME: ${{ secrets.MM_MOBILE_E2E_ADMIN_USERNAME }}
|
|
MM_MOBILE_E2E_ADMIN_PASSWORD: ${{ secrets.MM_MOBILE_E2E_ADMIN_PASSWORD }}
|
|
MM_MOBILE_E2E_ZEPHYR_API_KEY: ${{ secrets.MM_MOBILE_E2E_ZEPHYR_API_KEY }}
|
|
MM_MOBILE_E2E_TEST_CYCLE_LINK_PREFIX: ${{ secrets.MM_MOBILE_E2E_TEST_CYCLE_LINK_PREFIX }}
|
|
MM_MOBILE_E2E_WEBHOOK_URL: ${{ secrets.MM_MOBILE_E2E_WEBHOOK_URL }}
|
|
MM_MOBILE_DETOX_AWS_ACCESS_KEY_ID: ${{ secrets.MM_MOBILE_DETOX_AWS_ACCESS_KEY_ID }}
|
|
MM_MOBILE_DETOX_AWS_SECRET_ACCESS_KEY: ${{ secrets.MM_MOBILE_DETOX_AWS_SECRET_ACCESS_KEY }}
|
|
|
|
update-final-status-ios:
|
|
runs-on: ubuntu-22.04
|
|
if: always() && (inputs.PLATFORM == 'ios' || inputs.PLATFORM == 'both')
|
|
permissions:
|
|
contents: read
|
|
statuses: write
|
|
needs:
|
|
- run-ios-tests
|
|
steps:
|
|
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
with:
|
|
ref: ${{ inputs.MOBILE_VERSION }}
|
|
- uses: ./.github/actions/update-commit-status
|
|
env:
|
|
GITHUB_TOKEN: ${{ github.token }}
|
|
with:
|
|
repository_full_name: ${{ github.repository }}
|
|
commit_sha: ${{ inputs.MOBILE_VERSION }}
|
|
context: e2e/detox-ios-tests
|
|
description: >-
|
|
${{ needs.run-ios-tests.result == 'skipped' && 'Build failed — iOS detox tests did not run'
|
|
|| needs.run-ios-tests.outputs.FAILURES == '-1' && 'All test machines failed before producing results'
|
|
|| (needs.run-ios-tests.outputs.FAILURES == '0' && needs.run-ios-tests.outputs.SKIPPED > '0') && format('{0} passed, {1} skipped', needs.run-ios-tests.outputs.PASSES, needs.run-ios-tests.outputs.SKIPPED)
|
|
|| needs.run-ios-tests.outputs.FAILURES == '0' && format('All {0} tests passed', needs.run-ios-tests.outputs.TOTAL)
|
|
|| format('{0} passed, {1} failed, {2} skipped', needs.run-ios-tests.outputs.PASSES || '?', needs.run-ios-tests.outputs.FAILURES || '?', needs.run-ios-tests.outputs.SKIPPED || '0') }}
|
|
status: ${{ (needs.run-ios-tests.result == 'skipped' && 'failure') || needs.run-ios-tests.outputs.STATUS || 'failure' }}
|
|
target_url: ${{ needs.run-ios-tests.outputs.TARGET_URL }}
|
|
|
|
update-final-status-android:
|
|
runs-on: ubuntu-22.04
|
|
if: always() && (inputs.PLATFORM == 'android' || inputs.PLATFORM == 'both')
|
|
permissions:
|
|
contents: read
|
|
statuses: write
|
|
needs:
|
|
- run-android-tests
|
|
steps:
|
|
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
with:
|
|
ref: ${{ inputs.MOBILE_VERSION }}
|
|
- uses: ./.github/actions/update-commit-status
|
|
env:
|
|
GITHUB_TOKEN: ${{ github.token }}
|
|
with:
|
|
repository_full_name: ${{ github.repository }}
|
|
commit_sha: ${{ inputs.MOBILE_VERSION }}
|
|
context: e2e/detox-android-tests
|
|
description: >-
|
|
${{ needs.run-android-tests.result == 'skipped' && 'Build failed — Android detox tests did not run'
|
|
|| needs.run-android-tests.outputs.FAILURES == '-1' && 'All test machines failed before producing results'
|
|
|| (needs.run-android-tests.outputs.FAILURES == '0' && needs.run-android-tests.outputs.SKIPPED > '0') && format('{0} passed, {1} skipped', needs.run-android-tests.outputs.PASSES, needs.run-android-tests.outputs.SKIPPED)
|
|
|| needs.run-android-tests.outputs.FAILURES == '0' && format('All {0} tests passed', needs.run-android-tests.outputs.TOTAL)
|
|
|| format('{0} passed, {1} failed, {2} skipped', needs.run-android-tests.outputs.PASSES || '?', needs.run-android-tests.outputs.FAILURES || '?', needs.run-android-tests.outputs.SKIPPED || '0') }}
|
|
status: ${{ (needs.run-android-tests.result == 'skipped' && 'failure') || needs.run-android-tests.outputs.STATUS || 'failure' }}
|
|
target_url: ${{ needs.run-android-tests.outputs.TARGET_URL }}
|
|
|
|
update-final-status-ipad:
|
|
runs-on: ubuntu-22.04
|
|
if: always() && (inputs.PLATFORM == 'ios' || inputs.PLATFORM == 'both')
|
|
permissions:
|
|
contents: read
|
|
statuses: write
|
|
needs:
|
|
- run-ios-ipad-tests
|
|
steps:
|
|
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
with:
|
|
ref: ${{ inputs.MOBILE_VERSION }}
|
|
- uses: ./.github/actions/update-commit-status
|
|
env:
|
|
GITHUB_TOKEN: ${{ github.token }}
|
|
with:
|
|
repository_full_name: ${{ github.repository }}
|
|
commit_sha: ${{ inputs.MOBILE_VERSION }}
|
|
context: e2e/detox-ipad-tests
|
|
description: >-
|
|
${{ needs.run-ios-ipad-tests.result == 'skipped' && 'Build failed — iPad detox tests did not run'
|
|
|| needs.run-ios-ipad-tests.outputs.FAILURES == '-1' && 'All test machines failed before producing results'
|
|
|| (needs.run-ios-ipad-tests.outputs.FAILURES == '0' && needs.run-ios-ipad-tests.outputs.SKIPPED > '0') && format('{0} passed, {1} skipped', needs.run-ios-ipad-tests.outputs.PASSES, needs.run-ios-ipad-tests.outputs.SKIPPED)
|
|
|| needs.run-ios-ipad-tests.outputs.FAILURES == '0' && format('All {0} tests passed', needs.run-ios-ipad-tests.outputs.TOTAL)
|
|
|| format('{0} passed, {1} failed, {2} skipped', needs.run-ios-ipad-tests.outputs.PASSES || '?', needs.run-ios-ipad-tests.outputs.FAILURES || '?', needs.run-ios-ipad-tests.outputs.SKIPPED || '0') }}
|
|
status: ${{ (needs.run-ios-ipad-tests.result == 'skipped' && 'failure') || needs.run-ios-ipad-tests.outputs.STATUS || 'failure' }}
|
|
target_url: ${{ needs.run-ios-ipad-tests.outputs.TARGET_URL }}
|