Skip to content

build(deps): bump actions/cache from 4 to 5 #106

build(deps): bump actions/cache from 4 to 5

build(deps): bump actions/cache from 4 to 5 #106

Workflow file for this run

name: e2e Maestro
on:
workflow_dispatch:
pull_request:
branches: [main]
jobs:
test-android:
if: github.event_name != 'pull_request' || ( github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'android-test-github'))
name: e2e-android-test
runs-on: ubuntu-latest
env:
MAESTRO_CLI_ANALYSIS_NOTIFICATION_DISABLED: true
strategy:
fail-fast: false
matrix:
api-level: [35]
steps:
- name: 📦 Checkout project repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 📦 Setup bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: 📦 Install Project Dependencies
run: bun install --frozen-lockfile
shell: bash
- name: Set Up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
build-scan-publish: true
build-scan-terms-of-use-url: "https://gradle.com/terms-of-service"
build-scan-terms-of-use-agree: "yes"
- name: 📦 Install Maestro CLI
id: install-maestro
run: |
bun run install-maestro
- name: Add Maestro to path
run: echo "$HOME/.maestro/bin" >> $GITHUB_PATH
# Enable KVM to be able to use hardware accelerated emulators.
# https://github.com/ReactiveCircus/android-emulator-runner?tab=readme-ov-file#running-hardware-accelerated-emulators-on-linux-runners
- 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@v5
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 }}
arch: x86_64
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."
timeout-minutes: 5
- name: Run tests with Maestro
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
arch: x86_64
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: |
# Wait for system to settle
adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done'
# Retry once if necessary
cd example && bunx react-native run-android --mode=release --no-packager
bun test:e2e
- name: Upload artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: maestro-artifacts-android
path: ~/.maestro/tests/**/*
- name: Store tests result
uses: actions/upload-artifact@v4
with:
name: e2e_android_report
path: |
report.xml
# test-ios:
# name: e2e-ios-test
# if: github.event_name != 'pull_request' || ( github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'android-test-github'))
# # Silicon chips run through the iOS tests much faster
# runs-on: macos-latest
# env:
# MAESTRO_DRIVER_STARTUP_TIMEOUT: 300_000 # 5 minutes
# MAESTRO_CLI_ANALYSIS_NOTIFICATION_DISABLED: true
# steps:
# - name: 📦 Checkout project repo
# uses: actions/checkout@v4
# with:
# fetch-depth: 0
# - name: 📦 Setup bun
# uses: oven-sh/setup-bun@v2
# with:
# bun-version: latest
# - name: 📦 Install Project Dependencies
# run: bun install --frozen-lockfile
# shell: bash
# - uses: actions/cache@v5
# with:
# path: example/ios/Pods
# key: ${{ runner.os }}-pods-${{ hashFiles('example/ios/Podfile.lock') }}
# restore-keys: |
# ${{ runner.os }}-pods-
# - name: Install Pods
# run: cd example && bun run pod
# - name: Install Maestro CLI
# run: |
# curl -Ls "https://get.maestro.mobile.dev" | bash
# brew tap facebook/fb
# brew install facebook/fb/idb-companion
# - name: Add Maestro to path
# run: echo "$HOME/.maestro/bin" >> $GITHUB_PATH
# - name: Build iOS App
# run: |
# cd example && bunx react-native run-ios --mode Release --simulator "iPhone 16" --no-packager
# - name: Run tests
# run: |
# cd example && test:e2e
# - name: Upload artifacts
# if: always()
# uses: actions/upload-artifact@v4
# with:
# name: maestro-artifacts-ios
# path: ~/.maestro/tests/**/*
# - name: Store tests result
# uses: actions/upload-artifact@v4
# with:
# name: e2e_ios_report
# path: |
# report.xml