Update plugins and dependencies to latest compatible versions #57
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: Run tests with allure report | |
| on: | |
| pull_request: | |
| branches: | |
| - master | |
| paths: | |
| - 'aquality-appium-mobile-template/**' | |
| - 'aquality-appium-mobile-template-cucumber/**' | |
| - 'aquality-appium-mobile-template-testng/**' | |
| - 'scripts/**' | |
| push: | |
| branches: [ master ] | |
| workflow_dispatch: | |
| inputs: | |
| environment: | |
| type: choice | |
| description: 'App environment' | |
| required: true | |
| default: 'stage' | |
| options: | |
| - prod | |
| - stage | |
| jobs: | |
| build-and-test-android: | |
| env: | |
| CUCUMBER_ALLURE_RESULTS: aquality-appium-mobile-template-cucumber/target/allure-results | |
| TESTNG_ALLURE_RESULTS: aquality-appium-mobile-template-testng/target/allure-results | |
| SUBPROJECT_NAME: aquality-appium-mobile-template-cucumber | |
| ENVIRONMENT: ${{ github.event.inputs.environment == '' && 'stage' || github.event.inputs.environment }} | |
| ANDROID_PROFILE: Nexus 6 | |
| ANDROID_TARGET: google_apis | |
| ANDROID_API_LEVEL: 28 | |
| ANDROID_ARCH: x86_64 | |
| concurrency: test-android-${{ github.event.inputs.environment == '' && 'stage' || github.event.inputs.environment }} | |
| name: Run tests against Android | |
| runs-on: ubuntu-latest | |
| outputs: | |
| maven_tests: ${{ steps.maven_tests.outcome }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'adopt' | |
| cache: maven | |
| - 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.ANDROID_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: ${{ env.ANDROID_API_LEVEL }} | |
| target: ${{ env.ANDROID_TARGET }} | |
| arch: ${{ env.ANDROID_ARCH }} | |
| profile: ${{ env.ANDROID_PROFILE }} | |
| 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: Install and Run Appium Server | |
| run: | | |
| chmod +x ./scripts/PrepareAppiumServerForAndroid.sh | |
| ./scripts/PrepareAppiumServerForAndroid.sh | |
| - name: Test against Android | |
| id: maven_tests | |
| uses: reactivecircus/android-emulator-runner@v2 | |
| with: | |
| api-level: ${{ env.ANDROID_API_LEVEL }} | |
| target: ${{ env.ANDROID_TARGET }} | |
| arch: ${{ env.ANDROID_ARCH }} | |
| profile: ${{ env.ANDROID_PROFILE }} | |
| 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: mvn test -DisRemote=true -DplatformName=android | |
| - name: Copy TestNG allure result to the Cucumber allure result | |
| if: always() | |
| run: cp -r ${{ env.TESTNG_ALLURE_RESULTS }}/. ${{ env.CUCUMBER_ALLURE_RESULTS }} | |
| - name: Upload results as artifacts | |
| if: always() | |
| uses: actions/upload-artifact@master | |
| with: | |
| name: allure-results-android | |
| path: ${{ env.SUBPROJECT_NAME }}/target/allure-results | |
| build-and-test-ios: | |
| env: | |
| CUCUMBER_ALLURE_RESULTS: aquality-appium-mobile-template-cucumber/target/allure-results | |
| TESTNG_ALLURE_RESULTS: aquality-appium-mobile-template-testng/target/allure-results | |
| SUBPROJECT_NAME: aquality-appium-mobile-template-cucumber | |
| ENVIRONMENT: ${{ github.event.inputs.environment == '' && 'stage' || github.event.inputs.environment }} | |
| IOS_SIM_MODEL: iPhone SE (3rd generation) | |
| IOS_SIM_OS_VERSION: '17.0' | |
| concurrency: test-ios-${{ github.event.inputs.environment == '' && 'stage' || github.event.inputs.environment }} | |
| name: Run tests against iOS | |
| runs-on: macos-14 | |
| outputs: | |
| maven_tests: ${{ steps.maven_tests.outcome }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up JDK 11 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '11' | |
| distribution: 'adopt' | |
| cache: maven | |
| - name: Install and Run Appium Server | |
| run: | | |
| chmod +x ./scripts/PrepareAppiumServerForIos.sh | |
| ./scripts/PrepareAppiumServerForIos.sh | |
| - name: Setup iOS simulator | |
| if: always() | |
| uses: futureware-tech/simulator-action@v2 | |
| with: | |
| model: ${{ env.IOS_SIM_MODEL }} | |
| os_version: ${{ env.IOS_SIM_OS_VERSION }} | |
| - name: Wait for simulator to be ready | |
| run: | | |
| SIM_UID="$(xcrun simctl list devices | grep -m 1 "$IOS_SIM_MODEL" | grep -E -o -i "([0-9A-F]{8}-([0-9A-F]{4}-){3}[0-9A-F]{12})")" | |
| xcrun simctl bootstatus $SIM_UID | |
| - name: Test against iOS | |
| if: always() | |
| id: maven_tests | |
| run: mvn test -DisRemote=true -DplatformName=ios | |
| - name: Copy TestNG allure result to the Cucumber allure result | |
| if: always() | |
| run: cp -r ${{ env.TESTNG_ALLURE_RESULTS }}/. ${{ env.CUCUMBER_ALLURE_RESULTS }} | |
| - name: Upload results as artifacts | |
| if: always() | |
| uses: actions/upload-artifact@master | |
| with: | |
| name: allure-results-ios | |
| path: ${{ env.SUBPROJECT_NAME }}/target/allure-results | |
| deploy-report: | |
| if: always() | |
| name: Generate and deploy Allure Report | |
| needs: [build-and-test-android, build-and-test-ios] | |
| runs-on: ubuntu-latest | |
| env: | |
| GH_PAGES_URL: https://aquality-automation.github.io/aquality-appium-mobile-java-template | |
| steps: | |
| - name: Get Allure history | |
| uses: actions/checkout@v4 | |
| if: always() | |
| continue-on-error: true | |
| with: | |
| ref: gh-pages | |
| path: gh-pages | |
| - name: Download Android results artifacts | |
| if: always() | |
| uses: actions/download-artifact@master | |
| with: | |
| name: allure-results-android | |
| path: target/allure-results | |
| - name: Download iOS results artifacts | |
| if: always() | |
| uses: actions/download-artifact@master | |
| with: | |
| name: allure-results-ios | |
| path: target/allure-results | |
| - name: Generate Allure Report | |
| uses: simple-elf/allure-report-action@master | |
| if: always() | |
| id: allure-report | |
| with: | |
| allure_results: target/allure-results | |
| gh_pages: gh-pages | |
| allure_report: allure-report | |
| allure_history: allure-history | |
| keep_reports: 20 | |
| - name: Deploy report to Github Pages | |
| if: always() | |
| uses: peaceiris/actions-gh-pages@v2 | |
| env: | |
| PERSONAL_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| PUBLISH_BRANCH: gh-pages | |
| PUBLISH_DIR: allure-history | |
| - name: Post the link to the report | |
| if: always() | |
| uses: Sibz/github-status-action@v1 | |
| with: | |
| authToken: ${{secrets.GITHUB_TOKEN}} | |
| context: 'Test report' | |
| state: ${{ needs.build-and-test-android.outputs.maven_tests == 'success' && needs.build-and-test-ios.outputs.maven_tests == 'success' && 'success' || 'failure' }} | |
| sha: ${{github.event.pull_request.head.sha || github.sha}} | |
| target_url: ${{ env.GH_PAGES_URL }}/${{github.run_number}}/ |