DIA-3802 git action tests pipeline #45
Workflow file for this run
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: UI tests | |
on: [pull_request] | |
jobs: | |
Test: | |
runs-on: macos-13 | |
name: ClickAcceptAllButtonTest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: zulu | |
java-version: 17 | |
- name: Install and run Appium Server | |
run: | | |
npm i --location=global appium | |
appium driver install uiautomator2 | |
appium driver install xcuitest | |
appium plugin install --source=npm appium-altunity-plugin | |
cwd=$(pwd) | |
pushd "$cwd" | |
mkdir logs | |
cd logs | |
echo "appium" > appiumLog.txt | |
popd | |
appium --use-plugins=altunity &>logs/appiumLog.txt & | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: '8.0' | |
- name: Install AltTester Server | |
run: | | |
cwd=$(pwd) | |
pushd "$cwd" | |
cd logs | |
echo "alttester" > altTesterLog.txt | |
echo "alttester" > altTesterComLog.txt | |
wget https://alttester.com/app/uploads/AltTester/desktop/AltTesterDesktopPackageMac__v2.1.2.zip | |
unzip AltTesterDesktopPackageMac__v2.1.2.zip | |
cd AltTesterDesktopPackageMac__v2.1.2 | |
hdiutil attach AltTesterDesktop__v2.1.2.dmg | |
cp -R /Volumes/AltTesterDesktop/AltTesterDesktop.app ~ | |
popd | |
- name: Gradle cache | |
uses: gradle/actions/setup-gradle@v3 | |
- name: AVD cache | |
uses: actions/cache@v4 | |
id: avd-cache | |
with: | |
path: | | |
~/.android/avd/* | |
~/.android/adb* | |
key: avd-34 | |
- 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: 34 | |
target: google_apis | |
force-avd-creation: false | |
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
disable-animations: false | |
arch: x86_64 | |
script: echo "Generated AVD snapshot for caching." | |
- name: Run test | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: 34 | |
target: google_apis | |
force-avd-creation: false | |
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
disable-animations: true | |
arch: x86_64 | |
script: | | |
chmod -R 777 UI-TESTS | |
cd ~ && AltTesterDesktop.app/Contents/MacOS/AltTesterDesktop -batchmode -nographics -port 13000 -license ${{ secrets.ALTTESTERLICENSEKEY }} -termsAndConditionsAccepted -logfile ~/work/unity-sdk/unity-sdk/logs/altTesterLog.txt &>~/work/unity-sdk/unity-sdk/logs/altTesterComLog.txt & | |
cd UI-TESTS && dotnet test -s android.runsettings --filter Name=ClickAcceptAllButtonTest | |
- name: Archive logs | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: logs | |
path: logs/ | |
compression-level: 0 | |