Repository navigation
build(samples): [Sample Tests 47] Move the JVM samples to their own build #15630
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: 'Integration Tests' | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| name: Ui tests | |
| runs-on: ubuntu-latest | |
| # we copy the secret to the env variable in order to access it in the workflow | |
| env: | |
| SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }} | |
| SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }} | |
| GRADLE_ENCRYPTION_KEY: ${{ secrets.GRADLE_ENCRYPTION_KEY }} | |
| steps: | |
| - name: Git checkout | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| submodules: 'recursive' | |
| - name: 'Set up Java: 17' | |
| uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6.1.0 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@3f5f9adaf7d9fecd50b5935e54106014257a94e6 # v6.4.0 | |
| with: | |
| cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} | |
| # Clean, build and release a test apk, but only if we will run the benchmark | |
| - name: Make assembleUiTests | |
| if: env.SAUCE_USERNAME != null | |
| run: make assembleUiTests | |
| - name: Install SauceLabs CLI | |
| uses: saucelabs/saucectl-run-action@283660aa934c02723c497efa151d582a3acc5801 # pin@v4.5.0 | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| with: | |
| skip-run: true | |
| if: env.SAUCE_USERNAME != null | |
| - name: Run Tests | |
| id: saucelabs | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| run: | | |
| exec &> >(tee -a "test_logs.txt") | |
| saucectl run -c .sauce/sentry-uitest-android-ui.yml | |
| if: env.SAUCE_USERNAME != null | |
| continue-on-error: true | |
| - name: Verify Test Results | |
| run: | | |
| processCrashed=$(cat test_logs.txt | grep "Instrumentation run failed due to 'Process crashed.'" | wc -l) | |
| if [[ ${{ steps.saucelabs.outcome }} == 'success' ]]; then | |
| exit 0 | |
| elif [[ "$processCrashed" -ne 0 ]]; then | |
| exit 0 | |
| else | |
| exit 1 | |
| fi | |
| if: env.SAUCE_USERNAME != null | |
| - name: Install Sentry CLI | |
| if: ${{ !cancelled() && env.SAUCE_USERNAME != null }} | |
| uses: getsentry/action-setup-cli@70d7e587b84c2e78cf4d37cd33d7b74fb3729c1b # v1 | |
| - name: Upload Replay Snapshots to Sentry | |
| # Skip on PRs from forks, which don't have access to the upload secret | |
| if: ${{ !cancelled() && env.SAUCE_USERNAME != null && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) }} | |
| run: | | |
| # find instead of `shopt -s globstar`, which macOS's bash 3.2 doesn't support | |
| mkdir -p replay-snapshots | |
| if [ -d artifacts ]; then | |
| find artifacts -type f -name '*.png' -exec cp {} replay-snapshots/ \; | |
| fi | |
| if [ -n "$(ls -A replay-snapshots)" ]; then | |
| sentry-cli snapshots upload ./replay-snapshots \ | |
| --app-id sentry-android-replay | |
| else | |
| echo "No replay snapshot files found, skipping upload" | |
| fi | |
| env: | |
| SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
| SENTRY_ORG: sentry-sdks | |
| SENTRY_PROJECT: sentry-android |