regressions on refs/heads/dev #286
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: iOS regression tests | |
| run-name: '${{ inputs.RISK }} regressions on ${{ github.head_ref || github.ref }}' | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| APK_URL: | |
| description: 'ipa url to test (.tar.xz)' | |
| required: true | |
| type: string | |
| BUILD_NUMBER: | |
| description: 'build number used for the report (e.g. 2.11.0)' | |
| required: true | |
| type: string | |
| RISK: | |
| description: 'risks to target' | |
| required: false | |
| type: choice | |
| options: | |
| - 'high-risk' | |
| - 'medium-risk' | |
| - 'low-risk' | |
| - '' | |
| ALLURE_ENABLED: | |
| description: 'generate allure report' | |
| required: false | |
| default: 'true' | |
| type: choice | |
| options: | |
| - 'true' | |
| - 'false' | |
| PLAYWRIGHT_RETRIES_COUNT: | |
| description: 'retries of failing tests to do at most' | |
| required: true | |
| type: choice | |
| options: | |
| - '0' | |
| - '1' | |
| - '2' | |
| default: '0' | |
| PLAYWRIGHT_WORKERS_COUNT: | |
| description: 'number of workers to use (ios only)' | |
| required: true | |
| type: choice | |
| options: | |
| - '1' | |
| - '2' | |
| - '3' | |
| default: '3' | |
| LOG_LEVEL: | |
| description: 'Test logging verbosity (WARNING: anything other than minimal mode may crash GitHub Actions on large test runs)' | |
| required: true | |
| type: choice | |
| options: | |
| - 'minimal' # Recommended for full regressions | |
| - 'failures' # Show failed test logs only | |
| - 'verbose' # All test logs - use with caution! | |
| default: 'minimal' | |
| jobs: | |
| ios-regression: | |
| runs-on: [self-hosted, macOS] | |
| env: | |
| PLATFORM: 'ios' | |
| APK_URL: ${{ github.event.inputs.APK_URL }} | |
| BUILD_NUMBER: ${{ github.event.inputs.BUILD_NUMBER }} | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| CI: 1 | |
| ALLURE_ENABLED: ${{ github.event.inputs.ALLURE_ENABLED}} | |
| IOS_APP_PATH_PREFIX: './extracted/Session.app' | |
| ANDROID_APK: '<just_not_empty>' | |
| APPIUM_ADB_FULL_PATH: '<just_not_empty>' | |
| ANDROID_SDK_ROOT: '<just_not_empty>' | |
| PLAYWRIGHT_RETRIES_COUNT: ${{ github.event.inputs.PLAYWRIGHT_RETRIES_COUNT }} | |
| _TESTING: 1 # Always hide webdriver logs (@appium/support/ flag) | |
| PRINT_FAILED_TEST_LOGS: ${{ github.event.inputs.LOG_LEVEL != 'minimal' && '1' || '0' }} # Show stdout/stderr if test fails (@session-foundation/playwright-reporter/ flag) | |
| PRINT_ONGOING_TEST_LOGS: ${{ github.event.inputs.LOG_LEVEL == 'verbose' && '1' || '0' }} # Show everything as it happens (@session-foundation/playwright-reporter/ flag) | |
| PLAYWRIGHT_WORKERS_COUNT: 3 # for iOS, this is the max we can have on our self-hosted runner | |
| SDK_MANAGER_FULL_PATH: '<just_not_empty>' | |
| AVD_MANAGER_FULL_PATH: '<just_not_empty>' | |
| ANDROID_SYSTEM_IMAGE: '<just_not_empty>' | |
| EMULATOR_FULL_PATH: '<just_not_empty>' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| lfs: true | |
| - name: Fetch result history from gh-pages | |
| uses: ./github/actions/fetch-allure-history | |
| if: ${{ env.ALLURE_ENABLED == 'true' }} | |
| with: | |
| PLATFORM: ${{ env.PLATFORM }} | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Download ipa and extract it | |
| run: | | |
| curl -o session-ios.sim.tar.xz ${{ github.event.inputs.APK_URL }} | |
| ls | |
| pwd | |
| tar -tf session-ios.sim.tar.xz | |
| tar xf session-ios.sim.tar.xz | |
| mkdir -p extracted | |
| mv session-ios-*-sim/*.app extracted/ | |
| ls extracted | |
| - name: Setup for both platforms | |
| uses: ./github/actions/setup | |
| - name: Stop simulators | |
| shell: bash | |
| run: | | |
| npx --yes ts-node scripts/stop_ios.ts | |
| - name: Start simulators | |
| shell: bash | |
| if: false # appium is starting the simulators (seems to be somewhat more reliable) | |
| run: | | |
| npx --yes ts-node scripts/start_ios.ts # don't auto start the simulators, let appium do it (seems somewhat more reliable) | |
| - name: List tests part of this run | |
| uses: ./github/actions/list-tests | |
| with: | |
| PLATFORM: ${{ env.PLATFORM }} | |
| RISK: ${{ github.event.inputs.RISK }} | |
| - name: Run the iOS tests (all device counts) | |
| env: | |
| DEVICES_PER_TEST_COUNT: 4 | |
| _TESTING: ${{ env._TESTING }} | |
| PRINT_FAILED_TEST_LOGS: ${{ env.PRINT_FAILED_TEST_LOGS }} | |
| PRINT_ONGOING_TEST_LOGS: ${{ env.PRINT_ONGOING_TEST_LOGS }} | |
| run: | | |
| pwd | |
| npx playwright test --grep "(?=.*@${PLATFORM})(?=.*@${{ github.event.inputs.RISK }})" #Note: this has to be double quotes | |
| - name: Generate and publish test report | |
| uses: ./github/actions/generate-publish-test-report | |
| if: ${{ always() && env.ALLURE_ENABLED == 'true' }} | |
| with: | |
| PLATFORM: ${{ env.PLATFORM }} | |
| BUILD_NUMBER: ${{ env.BUILD_NUMBER }} | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| APK_URL: ${{env.APK_URL}} | |
| RISK: ${{github.event.inputs.RISK}} | |
| GITHUB_RUN_NUMBER: ${{ github.run_number }} | |
| GITHUB_RUN_ATTEMPT: ${{ github.run_attempt }} | |
| - name: Upload results of this run | |
| uses: ./github/actions/upload-test-results | |
| with: | |
| PLATFORM: ${{ env.PLATFORM }} | |
| UPLOAD_IDENTIFIER: 'devices-other-test-run' | |
| - name: Upload csv of this whole run | |
| uses: ./github/actions/upload-csv-test-results | |
| if: always() | |
| with: | |
| PLATFORM: ${{ env.PLATFORM }} | |
| - name: Stop emulators | |
| if: always() | |
| continue-on-error: true # just so we don't fail | |
| shell: bash | |
| run: | | |
| source ./scripts/ci.sh | |
| npx --yes ts-node scripts/stop_ios.ts |