mattermost-mobile-upstream/.github/workflows/compatibility-matrix-testing.yml
Nuno Simões 9f0c68373c
workflows, fast lane: upload beta / release artifacts only to one bucket (#9570)
* fastlane: add s3_client_oidc and support only one bucket

- s3_client_oidc: support new buckets only with IAM / OIDC (s3_client_oidc:true). In pull-requests
the pipelines are still using static credentials which must be udpated
and follow ups (default).
- Support only one bucket for beta / releases, e.g. start using only
s3_bucket_name to put object and upload
- Links need to use DNS for beta / releases and keep using
bucket name for pull-requests.
- env files for beta / releases only with dns while
bucket name being set in workflow.

* workflows: upload only to the new bucket

- use only one S3 bucket with OIDC for release/beta, keep static creds for build-pr
- build-ios-release: OIDC + upload_artifacts_to_s3 with s3_client_oidc:true; simulator upload via upload_artifacts_to_s3 with s3_client_oidc:true
- build-ios-beta: simulator upload_artifacts_to_s3 with s3_client_oidc:true; beta upload with s3_client_oidc:true
- build-android-release / build-android-beta: AWS_BUCKET_NAME from new bucket, upload_artifacts_to_s3 with s3_client_oidc:true
- build-pr: keep AWS_ACCESS_KEY_ID/SECRET for iOS and Android; Android PR add separate S3 upload step with run..."

* relase: adjust release bucket name

* ci-pr: add upload artifacts to s3 to ios

* fsatlane: fix dns name in env ios release

* workflows, fastlane: dont upload artifacts to s3 in simulator

- fastlane `lane :simulator` just build the artifact and if we
want to upload we need to use `lane :upload_artifacts_to_s3` ...
- dont upload artifacts to s3 bucket in e2e workflows because it
is enough use github artifact for this.

* fastlane: add missing aws_bucket_dns_name

* fastlane: use error instead error to fail pipeline
2026-03-31 17:51:43 +02:00

145 lines
4.7 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
cmt_run_id:
description: "CMT provisioner run ID used for instance cleanup"
required: false
default: "0"
type: string
jobs:
## This is picked up after the finish for cleanup
upload-cmt-server-detals:
runs-on: ubuntu-22.04
steps:
- name: cmt/generate-instance-details-file
run: echo '${{ inputs.CMT_MATRIX }}' > instance-details.json
- name: cmt/upload-instance-details
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: instance-details.json
path: instance-details.json
retention-days: 1
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
needs:
- calculate-commit-hash
steps:
- uses: mattermost/actions/delivery/update-commit-status@d5174b860704729f4c14ef8489ae075742bfa08a
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
# 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
detox-e2e:
name: mobile-cmt-${{ matrix.server.version }}
uses: ./.github/workflows/e2e-ios-template.yml
needs:
- build-ios-simulator
strategy:
fail-fast: false
matrix: ${{ fromJson(inputs.CMT_MATRIX) }}
secrets: inherit
with:
run-type: "RELEASE"
MM_TEST_SERVER_URL: ${{ matrix.server.url }}
MOBILE_VERSION: ${{ inputs.MOBILE_VERSION }}
update-final-status:
runs-on: ubuntu-22.04
if: always()
needs:
- calculate-commit-hash
- detox-e2e
steps:
- uses: mattermost/actions/delivery/update-commit-status@main
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: ${{ needs.detox-e2e.outputs.STATUS }}
target_url: ${{ needs.detox-e2e.outputs.TARGET_URL }}
- name: cmt/cleanup-instances
if: ${{ inputs.cmt_run_id != '0' && inputs.cmt_run_id != '' }}
env:
MATTERWICK_URL: ${{ vars.MATTERWICK_URL }}
CMT_RUN_ID: ${{ inputs.cmt_run_id }}
run: |
curl -s -X POST "${MATTERWICK_URL}/cleanup_e2e" \
-H "Content-Type: application/json" \
-d "{\"repo\": \"mattermost-mobile\", \"run_id\": \"${CMT_RUN_ID}\"}" \
--fail-with-body || echo "Cleanup request failed (non-fatal)"