Skip to content

Commit

Permalink
chore: moved android e2e to ubuntu (#2196)
Browse files Browse the repository at this point in the history
## Description

This PR intents to move android e2e test to ubuntu to avoid random
crashes. Inspired by changes made by @kirillzyusko in
[react-native-keyboard-controller](https://github.com/kirillzyusko/react-native-keyboard-controller).

## Changes

- Changed workflow's `runs-on`
- Bump deps
- Added necessary extra steps

<!--

## Screenshots / GIFs

Here you can add screenshots / GIFs documenting your change.

You can add before / after section if you're changing some behavior.

### Before

### After

-->

## Test code and steps to reproduce

<!--
Please include code that can be used to test this change and short
description how this example should work.
This snippet should be as minimal as possible and ready to be pasted
into editor (don't exclude exports or remove "not important" parts of
reproduction example)
-->

## Checklist

- [x] Ensured that CI passes
  • Loading branch information
alduzy committed Jun 28, 2024
1 parent ade2e20 commit e02b45b
Showing 1 changed file with 30 additions and 7 deletions.
37 changes: 30 additions & 7 deletions .github/workflows/android-e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,30 @@ on:
workflow_dispatch:
jobs:
test:
runs-on: macos-12
runs-on: ubuntu-latest
timeout-minutes: 60
env:
WORKING_DIRECTORY: Example
API_LEVEL: 34
concurrency:
group: android-e2e-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
tool-cache: true
android: false
- name: Set up JDK 17
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'zulu'
cache: 'gradle'
- name: Use Node.js 18
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'yarn'
Expand All @@ -48,23 +54,40 @@ jobs:
name: Reinstall node dependencies
working-directory: ${{ env.WORKING_DIRECTORY }}
run: yarn
- name: Install AVD dependencies
run: |
sudo apt update
sudo apt-get install -y libpulse0 libgl1
- name: Build app
working-directory: ${{ env.WORKING_DIRECTORY }}
run: yarn build-e2e-android
- 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-${{ env.API_LEVEL }}
- name: Run emulator and tests
uses: reactivecircus/android-emulator-runner@v2
with:
working-directory: ${{ env.WORKING_DIRECTORY }}
api-level: 31
target: aosp_atd
api-level: ${{ env.API_LEVEL }}
target: default
profile: pixel_2
ram-size: '4096M'
disk-size: '10G'
disable-animations: false
avd-name: e2e_emulator
arch: x86_64
script: yarn test-e2e-android
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: android-fail-screen-shots
Expand Down

0 comments on commit e02b45b

Please sign in to comment.