name: PR check # Builds every pull request (no release) and runs the mini player check on an emulator. Its log shows compile # errors, crashes and frames of each step (see .github/miniplayer.sh). on: pull_request: branches: [ "main" ] paths-ignore: [ "README.md", "images/**" ] concurrency: group: pr-check-${{ github.event.pull_request.number }} cancel-in-progress: true jobs: build: runs-on: ubuntu-latest steps: - name: Checkout Code uses: actions/checkout@v4 with: submodules: recursive - name: Apply submodule patches run: git -C MediaServiceCore apply --ignore-whitespace --whitespace=nowarn ../.github/patches/mediaservicecore.patch - name: Set up JDK 17 uses: actions/setup-java@v4 with: java-version: '17' distribution: 'temurin' cache: 'gradle' - name: Build run: | chmod +x gradlew ./gradlew assembleStphoneRelease # The release publishes the arm64, armeabi-v7a (arm32) and universal APKs: all three must be built - name: Check the APKs run: | OUT=smarttubetv/build/outputs/apk/stphone/release ls -l $OUT BT=$(ls -d $ANDROID_HOME/build-tools/* | sort -V | tail -n 1) for ABI in arm64-v8a armeabi-v7a universal; do APK=$(ls $OUT/*_$ABI.apk) echo "$APK" $BT/aapt dump badging "$APK" | grep native-code done - name: Upload APK uses: actions/upload-artifact@v4 with: name: pr-apk path: smarttubetv/build/outputs/apk/stphone/release/*_universal.apk retention-days: 3 emulator: needs: build runs-on: ubuntu-latest timeout-minutes: 40 steps: - uses: actions/checkout@v4 - uses: actions/download-artifact@v4 with: name: pr-apk path: apk - name: Tools for the frame strips run: | cp apk/*.apk app.apk sudo apt-get update -qq && sudo apt-get install -y -qq ffmpeg imagemagick > /dev/null - name: Enable KVM run: | echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules sudo udevadm control --reload-rules sudo udevadm trigger --name-match=kvm - name: Mini player on the emulator uses: reactivecircus/android-emulator-runner@v2 with: api-level: 34 target: google_apis arch: x86_64 profile: pixel_6 disable-animations: false script: bash .github/miniplayer.sh - name: Upload results if: always() uses: actions/upload-artifact@v4 with: name: miniplayer-results path: smoke/