mirror of
https://github.com/mattermost/mattermost-mobile.git
synced 2026-11-17 17:08:16 +00:00
* ci(e2e): scheduled CMT trigger, fix push double-fire, drop cleanup call Aligns mobile E2E workflows with matterwick's webhook-driven model: - cmt-provisioner.yml: replace the old stub (which relied on the dead workflow_run-inputs path) with a lightweight monthly scheduled trigger (no inputs). matterwick provisions servers for its hardcoded version set and dispatches compatibility-matrix-testing.yml. - compatibility-matrix-testing.yml: remove the /cleanup_e2e curl step; matterwick destroys servers on the workflow_run completed event (SHA match).
342 lines
13 KiB
YAML
342 lines
13 KiB
YAML
name: Compatibility Matrix Testing
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
CMT_MATRIX:
|
|
description: "A JSON object representing the testing matrix"
|
|
required: true
|
|
type: string
|
|
MOBILE_VERSION:
|
|
description: "The mattermost mobile version to test"
|
|
required: true
|
|
|
|
# Cancel overlapping CMT runs for the same ref; matterwick cleans up cancelled servers via workflow_run completed.
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
calculate-commit-hash:
|
|
runs-on: ubuntu-22.04
|
|
outputs:
|
|
MOBILE_SHA: ${{ steps.repo.outputs.MOBILE_SHA }}
|
|
steps:
|
|
- name: cmt/checkout-mobile
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
with:
|
|
ref: ${{ inputs.MOBILE_VERSION }}
|
|
|
|
- name: cmt/calculate-mattermost-sha
|
|
id: repo
|
|
run: echo "MOBILE_SHA=$(git rev-parse HEAD)" >> ${GITHUB_OUTPUT}
|
|
|
|
update-initial-status:
|
|
runs-on: ubuntu-22.04
|
|
permissions:
|
|
contents: read
|
|
statuses: write
|
|
needs:
|
|
- calculate-commit-hash
|
|
steps:
|
|
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
with:
|
|
ref: ${{ inputs.MOBILE_VERSION }}
|
|
- uses: ./.github/actions/update-commit-status
|
|
if: ${{ needs.calculate-commit-hash.outputs.MOBILE_SHA != '' }}
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
repository_full_name: ${{ github.repository }}
|
|
commit_sha: ${{ needs.calculate-commit-hash.outputs.MOBILE_SHA }}
|
|
context: e2e/compatibility-matrix-testing
|
|
description: "Compatibility Matrix Testing for ${{ inputs.MOBILE_VERSION }} version"
|
|
status: pending
|
|
|
|
# Maestro only runs against the latest server version; matrix filtering happens here since job-level if: can't access matrix.
|
|
prepare-maestro-matrix:
|
|
runs-on: ubuntu-22.04
|
|
outputs:
|
|
matrix: ${{ steps.filter.outputs.matrix }}
|
|
steps:
|
|
- name: Filter CMT matrix to latest server only
|
|
id: filter
|
|
env:
|
|
CMT_MATRIX: ${{ inputs.CMT_MATRIX }}
|
|
run: |
|
|
matrix=$(echo "$CMT_MATRIX" | jq -c '{server: [.server[] | select(.latest == true)]}')
|
|
if [ "$(echo "$matrix" | jq '.server | length')" -eq 0 ]; then
|
|
matrix=$(echo "$CMT_MATRIX" | jq -c '{server: [.server[-1]]}')
|
|
fi
|
|
echo "matrix=$matrix" >> "$GITHUB_OUTPUT"
|
|
|
|
# Input follows the below schema
|
|
# {
|
|
# "server": [
|
|
# {
|
|
# "version": "9.6.1",
|
|
# "url": "https://delivery-cmt-8467830017-9-6-1.test.mattermost.cloud/"
|
|
# },
|
|
# {
|
|
# "version": "9.5.2",
|
|
# "url": "https://delivery-cmt-8467830017-9-5-2.test.mattermost.cloud/"
|
|
# }
|
|
# ]
|
|
# }
|
|
build-ios-simulator:
|
|
runs-on: macos-14
|
|
needs:
|
|
- update-initial-status
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
with:
|
|
ref: ${{ inputs.MOBILE_VERSION }}
|
|
|
|
- name: Prepare iOS Build
|
|
uses: ./.github/actions/prepare-ios-build
|
|
|
|
- name: Build iOS Simulator
|
|
env:
|
|
TAG: "${{ inputs.MOBILE_VERSION }}"
|
|
GITHUB_TOKEN: "${{ secrets.MM_MOBILE_GITHUB_TOKEN }}"
|
|
run: bundle exec fastlane ios simulator --env ios.simulator
|
|
working-directory: ./fastlane
|
|
|
|
- name: Upload iOS Simulator Build
|
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
|
with:
|
|
name: ios-build-simulator-${{ github.run_id }}
|
|
path: Mattermost-simulator-x86_64.app.zip
|
|
|
|
build-android-apk:
|
|
runs-on: ubuntu-latest-8-cores
|
|
needs:
|
|
- update-initial-status
|
|
env:
|
|
ORG_GRADLE_PROJECT_jvmargs: -Xmx8g
|
|
steps:
|
|
- name: Prune Docker to free up space
|
|
run: docker system prune -af
|
|
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
with:
|
|
ref: ${{ inputs.MOBILE_VERSION }}
|
|
|
|
- name: Prepare Android Build
|
|
uses: ./.github/actions/prepare-android-build
|
|
env:
|
|
STORE_FILE: ${{ secrets.MM_MOBILE_STORE_FILE }}
|
|
STORE_ALIAS: ${{ secrets.MM_MOBILE_STORE_ALIAS }}
|
|
STORE_PASSWORD: ${{ secrets.MM_MOBILE_STORE_PASSWORD }}
|
|
MATTERMOST_BUILD_GH_TOKEN: ${{ secrets.MATTERMOST_BUILD_GH_TOKEN }}
|
|
|
|
- name: Detox build
|
|
run: |
|
|
cd detox
|
|
npm ci --prefer-offline --no-audit --no-fund
|
|
npm run e2e:android-build
|
|
|
|
- name: Upload Android Build
|
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
|
with:
|
|
name: android-build-files-${{ github.run_id }}
|
|
path: "android/app/build/outputs/apk/**/*.apk"
|
|
|
|
build-android-apk-maestro:
|
|
runs-on: ubuntu-latest-8-cores
|
|
needs:
|
|
- update-initial-status
|
|
env:
|
|
ORG_GRADLE_PROJECT_jvmargs: -Xmx8g
|
|
steps:
|
|
- name: Prune Docker to free up space
|
|
run: docker system prune -af
|
|
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
with:
|
|
ref: ${{ inputs.MOBILE_VERSION }}
|
|
|
|
- name: Prepare Android Build
|
|
uses: ./.github/actions/prepare-android-build
|
|
env:
|
|
STORE_FILE: ${{ secrets.MM_MOBILE_STORE_FILE }}
|
|
STORE_ALIAS: ${{ secrets.MM_MOBILE_STORE_ALIAS }}
|
|
STORE_PASSWORD: ${{ secrets.MM_MOBILE_STORE_PASSWORD }}
|
|
MATTERMOST_BUILD_GH_TOKEN: ${{ secrets.MATTERMOST_BUILD_GH_TOKEN }}
|
|
|
|
- name: Build Maestro Android APK
|
|
uses: ./.github/actions/build-android-maestro-apk
|
|
|
|
- name: Upload Maestro Android Build
|
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
|
with:
|
|
name: android-maestro-build-files-${{ github.run_id }}
|
|
path: android/app/build/outputs/apk/release/
|
|
|
|
# latest entry runs full suite, older entries run smoke only. Job-level if: can't conditionally skip matrix legs, so inputs vary instead.
|
|
detox-e2e:
|
|
name: mobile-cmt-ios${{ matrix.server.latest && '-full' || '-smoke' }}-${{ matrix.server.version }}
|
|
uses: ./.github/workflows/e2e-ios-template.yml
|
|
needs:
|
|
- build-ios-simulator
|
|
strategy:
|
|
fail-fast: false
|
|
matrix: ${{ fromJson(inputs.CMT_MATRIX) }}
|
|
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 }}
|
|
with:
|
|
run-type: "RELEASE"
|
|
MM_TEST_SERVER_URL: ${{ matrix.server.url }}
|
|
MOBILE_VERSION: ${{ inputs.MOBILE_VERSION }}
|
|
search_path: ${{ matrix.server.latest && 'detox/e2e/test' || 'detox/e2e/test/products/channels/smoke_test' }}
|
|
parallelism: ${{ matrix.server.latest && '10' || '1' }}
|
|
testcase_failure_fatal: true
|
|
|
|
detox-ipad-e2e:
|
|
name: mobile-cmt-ipad-${{ matrix.server.version }}
|
|
uses: ./.github/workflows/e2e-ios-template.yml
|
|
needs:
|
|
- build-ios-simulator
|
|
strategy:
|
|
fail-fast: false
|
|
matrix: ${{ fromJson(inputs.CMT_MATRIX) }}
|
|
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 }}
|
|
with:
|
|
run-type: "RELEASE"
|
|
MM_TEST_SERVER_URL: ${{ matrix.server.url }}
|
|
MOBILE_VERSION: ${{ inputs.MOBILE_VERSION }}
|
|
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"
|
|
|
|
# Maestro runs only against the latest server version (no smoke-on-older variant).
|
|
maestro-ios-e2e:
|
|
name: mobile-cmt-maestro-ios-${{ matrix.server.version }}
|
|
uses: ./.github/workflows/e2e-maestro-template.yml
|
|
needs:
|
|
- build-ios-simulator
|
|
- prepare-maestro-matrix
|
|
strategy:
|
|
fail-fast: false
|
|
matrix: ${{ fromJson(needs.prepare-maestro-matrix.outputs.matrix) }}
|
|
secrets: inherit
|
|
with:
|
|
platform: ios
|
|
run-type: "RELEASE"
|
|
MM_TEST_SERVER_URL: ${{ matrix.server.url }}
|
|
MOBILE_VERSION: ${{ inputs.MOBILE_VERSION }}
|
|
testcase_failure_fatal: true
|
|
record_tests_in_zephyr: true
|
|
|
|
detox-android-e2e:
|
|
name: mobile-cmt-android${{ matrix.server.latest && '-full' || '-smoke' }}-${{ matrix.server.version }}
|
|
uses: ./.github/workflows/e2e-android-template.yml
|
|
needs:
|
|
- build-android-apk
|
|
strategy:
|
|
fail-fast: false
|
|
matrix: ${{ fromJson(inputs.CMT_MATRIX) }}
|
|
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 }}
|
|
with:
|
|
run-android-tests: true
|
|
run-type: "RELEASE"
|
|
MM_TEST_SERVER_URL: ${{ matrix.server.url }}
|
|
MOBILE_VERSION: ${{ inputs.MOBILE_VERSION }}
|
|
search_path: ${{ matrix.server.latest && 'detox/e2e/test' || 'detox/e2e/test/products/channels/smoke_test' }}
|
|
parallelism: ${{ matrix.server.latest && '10' || '1' }}
|
|
testcase_failure_fatal: true
|
|
|
|
# Maestro runs only against the latest server version (no smoke-on-older variant).
|
|
maestro-android-e2e:
|
|
name: mobile-cmt-maestro-android-${{ matrix.server.version }}
|
|
uses: ./.github/workflows/e2e-maestro-template.yml
|
|
needs:
|
|
- build-android-apk-maestro
|
|
- prepare-maestro-matrix
|
|
strategy:
|
|
fail-fast: false
|
|
matrix: ${{ fromJson(needs.prepare-maestro-matrix.outputs.matrix) }}
|
|
secrets: inherit
|
|
with:
|
|
platform: android
|
|
run-type: "RELEASE"
|
|
MM_TEST_SERVER_URL: ${{ matrix.server.url }}
|
|
MOBILE_VERSION: ${{ inputs.MOBILE_VERSION }}
|
|
artifact_run_id: ${{ github.run_id }}
|
|
testcase_failure_fatal: true
|
|
record_tests_in_zephyr: true
|
|
|
|
update-final-status:
|
|
runs-on: ubuntu-22.04
|
|
if: always()
|
|
permissions:
|
|
contents: read
|
|
statuses: write
|
|
needs:
|
|
- calculate-commit-hash
|
|
- detox-e2e
|
|
- detox-android-e2e
|
|
- detox-ipad-e2e
|
|
- maestro-ios-e2e
|
|
- maestro-android-e2e
|
|
steps:
|
|
- name: Determine overall status
|
|
id: status
|
|
run: |
|
|
if [[ "${{ needs.detox-e2e.result }}" == "success" && \
|
|
"${{ needs.detox-android-e2e.result }}" == "success" && \
|
|
"${{ needs.detox-ipad-e2e.result }}" == "success" && \
|
|
"${{ needs.maestro-ios-e2e.result }}" == "success" && \
|
|
"${{ needs.maestro-android-e2e.result }}" == "success" ]]; then
|
|
echo "status=success" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "status=failure" >> $GITHUB_OUTPUT
|
|
fi
|
|
|
|
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
with:
|
|
ref: ${{ inputs.MOBILE_VERSION }}
|
|
|
|
- uses: ./.github/actions/update-commit-status
|
|
if: ${{ needs.calculate-commit-hash.outputs.MOBILE_SHA != '' }}
|
|
env:
|
|
GITHUB_TOKEN: ${{ github.token }}
|
|
with:
|
|
repository_full_name: ${{ github.repository }}
|
|
commit_sha: ${{ needs.calculate-commit-hash.outputs.MOBILE_SHA }}
|
|
context: e2e/compatibility-matrix-testing
|
|
description: Compatibility Matrix Testing for ${{ inputs.MOBILE_VERSION }} version
|
|
status: ${{ steps.status.outputs.status }}
|
|
target_url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
|
|
|
# Instance cleanup is handled by matterwick on workflow_run completed.
|
|
|