Skip to content

Commit

Permalink
Fix device tests action
Browse files Browse the repository at this point in the history
  • Loading branch information
bentrengrove committed Sep 5, 2024
1 parent 06b8df6 commit 1318d1c
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions .github/workflows/device-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,28 +48,36 @@ jobs:
~/.gradle/caches/build-cache-*
key: gradle-${{ hashFiles('checksum.txt') }}

# Determine what emulator image to use. We run all API 29+ emulators using
# Determine what emulator image to use. We run all API 28+ emulators using
# the google_apis image
- name: Determine emulator target
id: determine-target
env:
API_LEVEL: ${{ matrix.api-level }}
run: |
TARGET="default"
if [ "$API_LEVEL" -ge "29" ]; then
if [ "$API_LEVEL" -ge "28" ]; then
TARGET="google_apis"
fi
echo "TARGET=$TARGET" >> $GITHUB_OUTPUT
- name: Run device tests
- name: Determine emulator arch
id: determine-arch
env:
API_LEVEL: ${{ matrix.api-level }}
run: |
ARCH="x86"
if [ "$API_LEVEL" -ge "29" ]; then
ARCH="x86_64"
fi
echo "ARCH=$ARCH" >> $GITHUB_OUTPUT
- name: Run tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
arch: ${{ steps.determine-arch.outputs.ARCH }}
target: ${{ steps.determine-target.outputs.TARGET }}
profile: Galaxy Nexus
emulator-build: 7425822 # https://github.com/ReactiveCircus/android-emulator-runner/issues/160
# We run all tests, sharding them over 3 shards
script: ./scripts/run-tests.sh --log-file=logcat.txt --shard-index=${{ matrix.shard }} --shard-count=3
script: ./scripts/run-tests.sh --log-file=logcat.txt --run-affected --affected-base-ref=$BASE_REF --shard-index=${{ matrix.shard }} --shard-count=2

- name: Clean secrets
if: always()
Expand Down

0 comments on commit 1318d1c

Please sign in to comment.