diff --git a/.github/workflows/test-e2e-prod.yaml b/.github/workflows/test-e2e-prod.yaml new file mode 100644 index 0000000000..626aaba54b --- /dev/null +++ b/.github/workflows/test-e2e-prod.yaml @@ -0,0 +1,73 @@ +name: Test E2E (prod) + +on: + workflow_dispatch: + schedule: + - cron: '0 * * * *' + +jobs: + test-cloud-production: + # this job is the same as e2e-production in mobile-dev-inc/monorepo + runs-on: ubuntu-latest + if: github.repository == 'mobile-dev-inc/maestro' + + steps: + - name: Clone repository + uses: actions/checkout@v4 + + - name: Set up JDK 8 + uses: actions/setup-java@v4 + with: + distribution: zulu + java-version: 8 + + - name: Install Maestro + run: | + curl -Ls --retry 3 --retry-all-errors "https://get.maestro.mobile.dev" | bash + echo "${HOME}/.maestro/bin" >> $GITHUB_PATH + + - name: Print Maestro version + run: maestro --version + + - name: Download samples + run: maestro download-samples + + - name: Run iOS test + run: | + maestro cloud \ + --apiKey ${{ secrets.E2E_MOBILE_DEV_API_KEY }} \ + --timeout 180 \ + --fail-on-cancellation \ + --include-tags=advanced + samples/sample.zip samples + + - name: Run Android test + run: | + maestro cloud \ + --apiKey ${{ secrets.E2E_MOBILE_DEV_API_KEY }} \ + --fail-on-cancellation \ + --include-tags advanced \ + samples/sample.apk samples + + - name: Trigger alert on failure + if: ${{ false }} + # if: failure() + run: | + curl --request POST \ + --url "https://events.pagerduty.com/v2/enqueue" \ + --header 'Content-Type: application/json' \ + --data '{ + "payload": { + "summary": "E2E test failed", + "source": "E2E test", + "severity": "critical" + }, + "routing_key": "${{ secrets.E2E_PAGER_DUTY_INTEGRATION_KEY }}", + "event_action": "trigger", + "links": [ + { + "href": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}", + "text": "Failed E2E test - Github Action" + } + ] + }' diff --git a/.github/workflows/e2e.yaml b/.github/workflows/test-e2e.yaml similarity index 58% rename from .github/workflows/e2e.yaml rename to .github/workflows/test-e2e.yaml index 8e4e008a18..be5dd98612 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/test-e2e.yaml @@ -1,4 +1,4 @@ -name: E2E test +name: Test E2E on: workflow_dispatch: @@ -131,7 +131,7 @@ jobs: - name: Run iOS test run: | maestro cloud \ - --apiKey=${{secrets.E2E_MOBILE_DEV_API_KEY}} \ + --apiKey ${{ secrets.E2E_MOBILE_DEV_API_KEY }} \ --timeout 180 \ --fail-on-cancellation \ --include-tags advanced \ @@ -141,85 +141,8 @@ jobs: - name: Run Android test run: | maestro cloud \ - --apiKey ${{secrets.E2E_MOBILE_DEV_API_KEY}} \ + --apiKey ${{ secrets.E2E_MOBILE_DEV_API_KEY }} \ --fail-on-cancellation \ --include-tags advanced \ samples/sample.apk \ samples - - - name: Trigger alert on failure - if: ${{ false }} - # if: failure() - run: | - curl --request POST \ - --url "https://events.pagerduty.com/v2/enqueue" \ - --header 'Content-Type: application/json' \ - --data '{ - "payload": { - "summary": "E2E test failed", - "source": "E2E test", - "severity": "critical" - }, - "routing_key": "${{ secrets.E2E_PAGER_DUTY_INTEGRATION_KEY }}", - "event_action": "trigger", - "links": [ - { - "href": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}", - "text": "Failed E2E test - Github Action" - } - ] - }' - - test-cloud-production: - # this job is the same as e2e-production in mobile-dev-inc/monorepo - runs-on: ubuntu-latest - - steps: - - name: Clone repository - uses: actions/checkout@v4 - - - name: Set up JDK 8 - uses: actions/setup-java@v4 - with: - distribution: zulu - java-version: 8 - - - name: Install Maestro - run: | - curl -Ls --retry 3 --retry-all-errors "https://get.maestro.mobile.dev" | bash - echo "${HOME}/.maestro/bin" >> $GITHUB_PATH - - - name: Print Maestro version - run: maestro --version - - - name: Download samples - run: maestro download-samples - - - name: Run iOS test - run: | - maestro cloud --apiKey=${{secrets.E2E_MOBILE_DEV_API_KEY}} --timeout=180 --fail-on-cancellation --include-tags=advanced samples/sample.zip samples - - name: Run Android test - run: | - maestro cloud --apiKey=${{secrets.E2E_MOBILE_DEV_API_KEY}} --fail-on-cancellation --include-tags=advanced samples/sample.apk samples - - name: Trigger alert on failure - if: ${{ false }} - # if: failure() - run: | - curl --request POST \ - --url "https://events.pagerduty.com/v2/enqueue" \ - --header 'Content-Type: application/json' \ - --data '{ - "payload": { - "summary": "E2E test failed", - "source": "E2E test", - "severity": "critical" - }, - "routing_key": "${{ secrets.E2E_PAGER_DUTY_INTEGRATION_KEY }}", - "event_action": "trigger", - "links": [ - { - "href": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}", - "text": "Failed E2E test - Github Action" - } - ] - }'