V2 new samples #70
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: test android sample | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - cppjs-core/** | |
| - cppjs-extensions/** | |
| - cppjs-packages/** | |
| - cppjs-plugins/** | |
| - cppjs-samples/** | |
| - .github/workflows/test-android-sample.yml | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - cppjs-core/cpp.js/** | |
| - cppjs-plugins/cppjs-plugin-metro/** | |
| - cppjs-plugins/cppjs-plugin-react-native/** | |
| - cppjs-samples/cppjs-sample-lib-prebuilt-matrix/** | |
| - cppjs-samples/cppjs-sample-mobile-reactnative-cli/** | |
| - .github/workflows/test-android-sample.yml | |
| permissions: {} | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 #v4 | |
| - uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'adopt' | |
| java-version: '17' | |
| - name: Use Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22.x | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Build cppjs-sample-lib-prebuilt-matrix (st + mt) | |
| # Glob picks up both @cpp.js/sample-lib-prebuilt-matrix and the | |
| # -multithread variant. The mt sample-mobile-reactnative-cli's | |
| # native.cpp does `#include <Matrix.h>` which resolves to the | |
| # prebuilt artifacts under matrix-mt's dist/prebuilt/<target>/ | |
| # — without this build the e2e:android step fails for the mt | |
| # sample with "fatal error: 'Matrix.h' file not found". | |
| run: pnpm --filter='@cpp.js/sample-lib-prebuilt-matrix*' run build:android | |
| - name: Install Maestro | |
| run: | | |
| curl -fsSL "https://get.maestro.mobile.dev" | bash | |
| echo "$HOME/.maestro/bin" >> $GITHUB_PATH | |
| - 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: Gradle cache | |
| uses: gradle/actions/setup-gradle@0bdd871935719febd78681f197cd39af5b6e16a6 #v4 | |
| - name: create AVD | |
| uses: reactivecircus/android-emulator-runner@e89f39f1abbbd05b1113a29cf4db69e7540cae5a #v2.37.0 | |
| with: | |
| api-level: 36 | |
| target: default | |
| arch: x86_64 | |
| cmake: 4.1.2 | |
| ndk: 29.0.14206865 | |
| force-avd-creation: false | |
| emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
| disable-animations: false | |
| script: echo "Generated AVD snapshot for caching." | |
| - name: E2E Android | |
| uses: reactivecircus/android-emulator-runner@e89f39f1abbbd05b1113a29cf4db69e7540cae5a #v2.37.0 | |
| with: | |
| api-level: 36 | |
| target: default | |
| arch: x86_64 | |
| cmake: 4.1.2 | |
| ndk: 29.0.14206865 | |
| 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: | | |
| adb logcat --clear | |
| adb logcat '*:D' > adb-log.txt & | |
| pnpm run e2e:android | |
| - name: Upload Adb Logs | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Adb Logs | |
| path: adb-log.txt | |
| - name: Upload report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: E2E Report | |
| path: ~/.maestro/tests/**/* |