Skip to content

Bump libraries

Bump libraries #138

Workflow file for this run

name: Ui Test
on:
pull_request:
workflow_dispatch:
jobs:
ui-tests:
timeout-minutes: 35
runs-on: ubuntu-latest
env:
androidApiVersion: 23
buildToolsVersion: 33.0.0
# TODO: Build tools version at here is fixed:
# https://github.com/ReactiveCircus/android-emulator-runner/blob/main/src/sdk-installer.ts#L7
# Update the version when it changes
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: '17'
- name: Detect gradle version
uses: actions/github-script@v6
id: gradle-version-detector
with:
result-encoding: string
script: |
const scriptPath = '/./.github/scripts/gradle-version-detector.js'
const script = require(`${process.env.GITHUB_WORKSPACE}${scriptPath}`)
return script()
- name: Fetch gradle cache
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-${{ steps.gradle-version-detector.outputs.result }}
- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Make user owner of Android Sdk directory
run: sudo chown $USER:$USER /usr/local/lib/android/sdk -R
- name: Fetch AVD Cache
uses: actions/cache@v3
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: ${{ runner.os }}-avd-${{ env.androidApiVersion }}
- name: Fetch Android SDK Cache
uses: actions/cache@v3
id: android-sdk-cache
with:
path: |
/usr/local/lib/android/sdk/emulator
/usr/local/lib/android/sdk/build-tools/${{ env.buildToolsVersion }}
/usr/local/lib/android/sdk/platform-tools
/usr/local/lib/android/sdk/platforms/android-${{ env.androidApiVersion }}
/usr/local/lib/android/sdk/system-images/android-${{ env.androidApiVersion }}
key: ${{ runner.os }}-android-sdk-${{ env.androidApiVersion }}
- name: Create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ env.androidApiVersion }}
arch: x86_64
ram-size: 2048M
disk-size: 1536M
force-avd-creation: false
disable-animations: true
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
script: echo "Generated AVD snapshot for caching."
- name: 🤖 Run Ui Tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ env.androidApiVersion }}
arch: x86_64
ram-size: 2048M
disk-size: 1536M
force-avd-creation: false
disable-animations: true
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
script: |
echo "Uninstalling debug and test apks"
adb uninstall com.yasinkacmaz.jetflix.debug.test
adb uninstall com.yasinkacmaz.jetflix.debug
echo "Successfully uninstalled debug and test apks"
./gradlew connectedCheck
- name: Publish Ui Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: ${{ github.event_name == 'pull_request' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
check_name: Ui Test Results
junit_files: '**/androidTest-results/**/*.xml'