Bump serialize-javascript and terser-webpack-plugin in /apps/engage-example #317
Workflow file for this run
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: Build Android on PRs | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| types: [opened, reopened, synchronize] | |
| # Cancel in-progress runs on the same PR to avoid wasting runner minutes. | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| NDK_VERSION: 29.0.14033849 | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| api-level: [ 34 ] | |
| newArchEnabled: [ true ] | |
| name: Build for API Level ${{ matrix.api-level }} using ${{matrix.newArchEnabled == true && 'New' || 'Old' }} Architecture | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 17 | |
| distribution: adopt | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| - name: Validate Gradle wrapper | |
| uses: gradle/actions/wrapper-validation@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: 'npm' | |
| - name: Run npm install | |
| run: npm ci --workspaces --include-workspace-root | |
| - name: Build workspaces | |
| run: npm run build | |
| - name: Run documentation tests | |
| run: npm test | |
| - name: Install & update e2e app with latest react-native-theoplayer | |
| working-directory: apps/e2e | |
| run: npm install react-native-theoplayer@latest | |
| - 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: AVD cache | |
| uses: actions/cache@v4 | |
| id: avd-cache | |
| with: | |
| path: | | |
| ~/.android/avd/* | |
| ~/.android/adb* | |
| key: avd-${{ matrix.api-level }} | |
| - 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: ${{ matrix.api-level }} | |
| target: google_apis | |
| arch: x86_64 | |
| cores: 2 | |
| ram-size: 3072M | |
| force-avd-creation: true | |
| emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
| disable-animations: true | |
| script: echo "Generated AVD snapshot for caching." | |
| - name: Cache NDK | |
| uses: actions/cache@v4 | |
| id: ndk-cache | |
| with: | |
| path: /usr/local/lib/android/sdk/ndk/${{ env.NDK_VERSION }} | |
| key: ndk-${{ env.NDK_VERSION }} | |
| - name: Install NDK | |
| if: steps.ndk-cache.outputs.cache-hit != 'true' | |
| run: echo "y" | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "ndk;${{ env.NDK_VERSION }}" | |
| - name: Configure gradle.properties | |
| working-directory: apps/e2e/android | |
| run: | | |
| echo "YOSPACE_USERNAME=${{ secrets.YOSPACE_USERNAME }}" >> ./gradle.properties | |
| echo "YOSPACE_PASSWORD=${{ secrets.YOSPACE_PASSWORD }}" >> ./gradle.properties | |
| echo "newArchEnabled=${{ matrix.newArchEnabled }}" >> ./gradle.properties | |
| # Only build the x86_64 ABI needed by the CI emulator. | |
| echo "reactNativeArchitectures=x86_64" >> ./gradle.properties | |
| - name: Run e2e tests | |
| uses: reactivecircus/android-emulator-runner@v2 | |
| with: | |
| api-level: ${{ matrix.api-level }} | |
| target: google_apis | |
| arch: x86_64 | |
| cores: 2 | |
| ram-size: 3072M | |
| force-avd-creation: false | |
| emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
| disable-animations: true | |
| script: npm run test:e2e:android | |
| working-directory: apps/e2e | |
| - name: Summarize results | |
| working-directory: apps/e2e | |
| if: always() | |
| run: | | |
| if [ -f cavy_results.md ]; then | |
| cat cavy_results.md >> $GITHUB_STEP_SUMMARY | |
| fi | |