Test App #21
This file contains 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 | |
on: | |
workflow_dispatch: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
env: | |
APK_PATH: ${{ github.workspace }}/app-release.apk | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download APK from S3 | |
uses: keithweaver/[email protected] | |
with: | |
source: 's3://appium-finna/finna.apk' | |
destination: ${{ env.APK_PATH }} | |
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws_region: ${{ secrets.AWS_DEFAULT_REGION }} | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
# Add Node modules caching | |
- name: Cache Node modules | |
uses: actions/cache@v4 | |
id: npm-cache | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Setup Java JDK | |
uses: actions/[email protected] | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: Setup Android SDK | |
uses: android-actions/setup-android@v3 | |
# Add Android SDK cache | |
- name: Cache Android SDK | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.android/cache | |
~/.android/repositories | |
key: ${{ runner.os }}-android-sdk-${{ hashFiles('~/.android/repositories') }} | |
restore-keys: | | |
${{ runner.os }}-android-sdk- | |
# Add Appium cache | |
- name: Cache Appium | |
uses: actions/cache@v4 | |
with: | |
path: ~/.appium | |
key: ${{ runner.os }}-appium-${{ hashFiles('**/package.json') }} | |
restore-keys: | | |
${{ runner.os }}-appium- | |
- name: Setup Appium | |
run: | | |
npm install -g appium | |
appium --version | |
appium driver install uiautomator2 || true | |
npm install -g appium-doctor | |
- name: Install wdio dependencies | |
if: steps.npm-cache.outputs.cache-hit != 'true' | |
run: npm install | |
- 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: Android Emulator Runner | |
uses: ReactiveCircus/[email protected] | |
continue-on-error: true | |
env: | |
FINNA_USER_EMAIL: ${{ secrets.FINNA_USER_EMAIL }} | |
FINNA_USER_PASSWORD: ${{ secrets.FINNA_USER_PASSWORD }} | |
FINNA_USER_PIN: ${{ secrets.FINNA_USER_PIN }} | |
MAILOSAUR_ID: ${{ secrets.MAILOSAUR_ID }} | |
MAILOSAUR_KEY: ${{ secrets.MAILOSAUR_KEY }} | |
PACKAGE_NAME: ${{ secrets.PACKAGE_NAME }} | |
with: | |
api-level: 33 | |
ram-size: 4096M | |
script: | | |
appium-doctor --android | |
npm run android | |
- name: Deploy Allure report | |
uses: cybersokari/[email protected] | |
with: | |
allure_results_path: ${{ github.workspace }}/reports/android/allure-results | |
target: firebase | |
google_credentials_json: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }} |