From 283aa370ef8ad2e7230e9c1f225c521ba2924959 Mon Sep 17 00:00:00 2001 From: Antonis Stamatiou Date: Mon, 10 Jun 2024 15:10:43 +0300 Subject: [PATCH] fix: Remove mobile builds out of the template --- .../compatibility-matrix-testing.yml | 30 ++++++++++++++++++- .github/workflows/e2e-detox-pr.yml | 28 ++++++++++++++++- .github/workflows/e2e-detox-release.yml | 29 +++++++++++++++++- .github/workflows/e2e-detox-scheduled.yml | 28 +++++++++++++++++ .github/workflows/e2e-detox-template.yml | 30 ------------------- 5 files changed, 112 insertions(+), 33 deletions(-) diff --git a/.github/workflows/compatibility-matrix-testing.yml b/.github/workflows/compatibility-matrix-testing.yml index 2b558e7ced8..a18e67935d7 100644 --- a/.github/workflows/compatibility-matrix-testing.yml +++ b/.github/workflows/compatibility-matrix-testing.yml @@ -68,11 +68,39 @@ jobs: # } # ] # } + build-ios-simulator: + runs-on: macos-14-large + needs: + - update-initial-status + steps: + - name: Checkout Repository + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + ref: ${{ inputs.MOBILE_VERSION }} + + - name: Prepare iOS Build + uses: ./.github/actions/prepare-ios-build + + - name: Build iOS Simulator + env: + TAG: "${{ inputs.MOBILE_VERSION }}" + AWS_ACCESS_KEY_ID: "${{ secrets.MM_MOBILE_BETA_AWS_ACCESS_KEY_ID }}" + AWS_SECRET_ACCESS_KEY: "${{ secrets.MM_MOBILE_BETA_AWS_SECRET_ACCESS_KEY }}" + 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@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 + 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-detox-template.yml needs: - - update-initial-status + - build-ios-simulator strategy: fail-fast: false matrix: ${{ fromJson(inputs.CMT_MATRIX) }} diff --git a/.github/workflows/e2e-detox-pr.yml b/.github/workflows/e2e-detox-pr.yml index aa908875035..9850d325cbe 100644 --- a/.github/workflows/e2e-detox-pr.yml +++ b/.github/workflows/e2e-detox-pr.yml @@ -22,11 +22,37 @@ jobs: description: Detox tests for mattermost mobile app have started ... status: pending + build-ios-simulator: + runs-on: macos-14-large + needs: + - update-initial-status + steps: + - name: Checkout Repository + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - name: Prepare iOS Build + uses: ./.github/actions/prepare-ios-build + + - name: Build iOS Simulator + env: + TAG: "${{ github.event.pull_request.head.sha }}" + AWS_ACCESS_KEY_ID: "${{ secrets.MM_MOBILE_BETA_AWS_ACCESS_KEY_ID }}" + AWS_SECRET_ACCESS_KEY: "${{ secrets.MM_MOBILE_BETA_AWS_SECRET_ACCESS_KEY }}" + 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@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 + with: + name: ios-build-simulator-${{ github.run_id }} + path: Mattermost-simulator-x86_64.app.zip + run-ios-tests-on-pr: name: iOS Mobile Tests on PR uses: ./.github/workflows/e2e-detox-template.yml needs: - - update-initial-status + - build-ios-simulator with: run-ios-tests: true run-android-tests: false diff --git a/.github/workflows/e2e-detox-release.yml b/.github/workflows/e2e-detox-release.yml index 17fb94abab0..7040e2ca399 100644 --- a/.github/workflows/e2e-detox-release.yml +++ b/.github/workflows/e2e-detox-release.yml @@ -19,10 +19,37 @@ jobs: description: Detox tests for mattermost mobile app have started ... status: pending + build-ios-simulator: + runs-on: macos-14-large + needs: + - update-initial-status + steps: + - name: Checkout Repository + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - name: Prepare iOS Build + uses: ./.github/actions/prepare-ios-build + + - name: Build iOS Simulator + env: + TAG: "${{ github.ref }}" + AWS_ACCESS_KEY_ID: "${{ secrets.MM_MOBILE_BETA_AWS_ACCESS_KEY_ID }}" + AWS_SECRET_ACCESS_KEY: "${{ secrets.MM_MOBILE_BETA_AWS_SECRET_ACCESS_KEY }}" + 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@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 + with: + name: ios-build-simulator-${{ github.run_id }} + path: Mattermost-simulator-x86_64.app.zip + run-ios-tests-on-release: name: iOS Mobile Tests on Release uses: ./.github/workflows/e2e-detox-template.yml - if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/heads/release-') }} + needs: + - build-ios-simulator with: run-ios-tests: true run-android-tests: false diff --git a/.github/workflows/e2e-detox-scheduled.yml b/.github/workflows/e2e-detox-scheduled.yml index 9734956c692..a21456e1854 100644 --- a/.github/workflows/e2e-detox-scheduled.yml +++ b/.github/workflows/e2e-detox-scheduled.yml @@ -18,9 +18,37 @@ jobs: description: Detox tests for mattermost mobile app have started ... status: pending + build-ios-simulator: + runs-on: macos-14-large + needs: + - update-initial-status + steps: + - name: Checkout Repository + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - name: Prepare iOS Build + uses: ./.github/actions/prepare-ios-build + + - name: Build iOS Simulator + env: + TAG: "${{ github.ref }}" + AWS_ACCESS_KEY_ID: "${{ secrets.MM_MOBILE_BETA_AWS_ACCESS_KEY_ID }}" + AWS_SECRET_ACCESS_KEY: "${{ secrets.MM_MOBILE_BETA_AWS_SECRET_ACCESS_KEY }}" + 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@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 + with: + name: ios-build-simulator-${{ github.run_id }} + path: Mattermost-simulator-x86_64.app.zip + run-ios-tests-on-main-scheduled: name: iOS Mobile Tests on Main (Scheduled) uses: ./.github/workflows/e2e-detox-template.yml + needs: + - build-ios-simulator with: run-ios-tests: true run-android-tests: false diff --git a/.github/workflows/e2e-detox-template.yml b/.github/workflows/e2e-detox-template.yml index 94b2f07d1c9..731950e5110 100644 --- a/.github/workflows/e2e-detox-template.yml +++ b/.github/workflows/e2e-detox-template.yml @@ -105,35 +105,6 @@ jobs: device_name: ${{ steps.resolve-device.outputs.DEVICE_NAME }} device_os_version: ${{ steps.resolve-device.outputs.DEVICE_OS_VERSION }} - build-ios-simulator: - if: ${{ inputs.run-ios-tests }} - runs-on: macos-14-large - needs: - - generate-specs - steps: - - name: Checkout Repository - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - with: - ref: ${{ inputs.MOBILE_VERSION }} - - - name: Prepare iOS Build - uses: ./.github/actions/prepare-ios-build - - - name: Build iOS Simulator - env: - TAG: "${{ needs.generate-specs.outputs.mobile_ref }}" - AWS_ACCESS_KEY_ID: "${{ secrets.MM_MOBILE_BETA_AWS_ACCESS_KEY_ID }}" - AWS_SECRET_ACCESS_KEY: "${{ secrets.MM_MOBILE_BETA_AWS_SECRET_ACCESS_KEY }}" - 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@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 - with: - name: ios-build-simulator-${{ github.run_id }} - path: Mattermost-simulator-x86_64.app.zip - e2e-ios: name: ios-detox-e2e-${{ matrix.runId }}-${{ matrix.deviceName }}-${{ matrix.deviceOsVersion }} if: ${{ inputs.run-ios-tests }} @@ -144,7 +115,6 @@ jobs: IOS: true needs: - generate-specs - - build-ios-simulator strategy: fail-fast: false matrix: ${{ fromJSON(needs.generate-specs.outputs.specs) }}