|
| 1 | +name: 'Integration Tests - Macrobenchmark' |
| 2 | +# Runs the sentry-uitest-android-macrobenchmark cold-start benchmark on a Sauce Labs real |
| 3 | +# device and recovers timeToInitialDisplay from the device log. |
| 4 | +# |
| 5 | +on: |
| 6 | + workflow_dispatch: |
| 7 | + |
| 8 | +concurrency: |
| 9 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 10 | + cancel-in-progress: true |
| 11 | + |
| 12 | +jobs: |
| 13 | + macrobenchmark: |
| 14 | + name: Macrobenchmark |
| 15 | + runs-on: ubuntu-latest |
| 16 | + |
| 17 | + # we copy the secret to the env variable in order to access it in the workflow |
| 18 | + env: |
| 19 | + SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }} |
| 20 | + |
| 21 | + steps: |
| 22 | + - name: Git checkout |
| 23 | + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 24 | + |
| 25 | + - name: 'Set up Java: 17' |
| 26 | + uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5 |
| 27 | + with: |
| 28 | + distribution: 'temurin' |
| 29 | + java-version: '17' |
| 30 | + |
| 31 | + - name: Setup Gradle |
| 32 | + uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6.3.0 |
| 33 | + |
| 34 | + - name: Assemble target app and Macrobenchmark apk |
| 35 | + if: env.SAUCE_USERNAME != null |
| 36 | + run: ./gradlew :sentry-samples:sentry-samples-android:assembleRelease :sentry-android-integration-tests:sentry-uitest-android-macrobenchmark:assembleBenchmark |
| 37 | + |
| 38 | + - name: Run Macrobenchmark in SauceLab |
| 39 | + uses: saucelabs/saucectl-run-action@283660aa934c02723c497efa151d582a3acc5801 # pin@v3 |
| 40 | + if: env.SAUCE_USERNAME != null |
| 41 | + env: |
| 42 | + GITHUB_TOKEN: ${{ github.token }} |
| 43 | + with: |
| 44 | + sauce-username: ${{ secrets.SAUCE_USERNAME }} |
| 45 | + sauce-access-key: ${{ secrets.SAUCE_ACCESS_KEY }} |
| 46 | + config-file: .sauce/sentry-uitest-android-macrobenchmark.yml |
| 47 | + |
| 48 | + # Runs even when the suite fails: a failed benchmark still logs whatever it managed to |
| 49 | + # measure, and the parser's own error explains what was missing. |
| 50 | + - name: Recover benchmark results from the device log |
| 51 | + if: ${{ !cancelled() && env.SAUCE_USERNAME != null }} |
| 52 | + run: | |
| 53 | + # Without pipefail the step passes on `tee`'s exit code, so a failed recovery |
| 54 | + # would report success while silently producing no results. |
| 55 | + set -o pipefail |
| 56 | + python3 scripts/parse-macrobenchmark-log.py ./artifacts \ |
| 57 | + --json-out ./artifacts/benchmarkData.json | tee -a "$GITHUB_STEP_SUMMARY" |
| 58 | +
|
| 59 | + - name: Upload Sauce artifacts |
| 60 | + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 |
| 61 | + if: ${{ !cancelled() }} |
| 62 | + with: |
| 63 | + name: macrobenchmark-results |
| 64 | + path: ./artifacts/ |
| 65 | + if-no-files-found: warn |
0 commit comments