|
| 1 | +name: UI Tests Common |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_call: |
| 5 | + inputs: |
| 6 | + fastlane_command: |
| 7 | + description: "The fastlane command to run" |
| 8 | + required: true |
| 9 | + type: string |
| 10 | + fastlane_command_extra_arguments: |
| 11 | + description: "Extra arguments for the fastlane command" |
| 12 | + required: false |
| 13 | + default: "" |
| 14 | + type: string |
| 15 | + xcresult_suffix: |
| 16 | + description: "Suffix for the xcresult artifact (if needed)" |
| 17 | + required: false |
| 18 | + default: "" |
| 19 | + type: string |
| 20 | + xcode_version: |
| 21 | + description: "Xcode version" |
| 22 | + required: true |
| 23 | + type: string |
| 24 | + build_with_make: |
| 25 | + description: "Build with make" |
| 26 | + required: false |
| 27 | + default: false |
| 28 | + type: boolean |
| 29 | + build_xcframework: |
| 30 | + description: "Build xcframework" |
| 31 | + required: false |
| 32 | + default: false |
| 33 | + type: boolean |
| 34 | + xcframework_type: |
| 35 | + description: "Parameters for the build script" |
| 36 | + required: false |
| 37 | + default: "" |
| 38 | + type: string |
| 39 | + macos_version: |
| 40 | + description: "macOS version" |
| 41 | + required: true |
| 42 | + type: string |
| 43 | + |
| 44 | +jobs: |
| 45 | + common-ui-tests: |
| 46 | + name: UI Tests Common |
| 47 | + runs-on: ${{ inputs.macos_version }} |
| 48 | + steps: |
| 49 | + - uses: actions/checkout@v4 |
| 50 | + |
| 51 | + - name: Print hardware info |
| 52 | + shell: bash |
| 53 | + run: system_profiler SPHardwareDataType |
| 54 | + |
| 55 | + - name: Setup Ruby |
| 56 | + uses: ruby/setup-ruby@13e7a03dc3ac6c3798f4570bfead2aed4d96abfb # v1.244.0 |
| 57 | + with: |
| 58 | + bundler-cache: true |
| 59 | + |
| 60 | + - run: ./scripts/ci-select-xcode.sh ${{ inputs.xcode_version }} |
| 61 | + shell: sh |
| 62 | + |
| 63 | + - run: make init-ci-build |
| 64 | + shell: sh |
| 65 | + if: ${{ inputs.build_with_make }} |
| 66 | + |
| 67 | + - run: make xcode |
| 68 | + shell: sh |
| 69 | + if: ${{ inputs.build_with_make }} |
| 70 | + |
| 71 | + - run: ./scripts/build-xcframework.sh ${{ inputs.xcframework_type }} |
| 72 | + shell: sh |
| 73 | + if: ${{ inputs.build_xcframework }} |
| 74 | + |
| 75 | + - name: Add Microphone permissions |
| 76 | + uses: ./.github/actions/add-microphone-permissions |
| 77 | + |
| 78 | + - name: Run Fastlane |
| 79 | + shell: sh |
| 80 | + run: bundle exec fastlane ${{ inputs.fastlane_command }} ${{ inputs.fastlane_command_extra_arguments }} |
| 81 | + |
| 82 | + - name: Publish Test Report |
| 83 | + uses: mikepenz/action-junit-report@65fe03598d8d251738592a497a9e8547a5c48eaa # v5.6.0 |
| 84 | + if: always() |
| 85 | + with: |
| 86 | + report_paths: "build/reports/junit.xml" |
| 87 | + fail_on_failure: true |
| 88 | + fail_on_parse_error: true |
| 89 | + detailed_summary: true |
| 90 | + |
| 91 | + - name: Upload Result Bundle |
| 92 | + uses: actions/upload-artifact@v4 |
| 93 | + if: ${{ failure() }} |
| 94 | + with: |
| 95 | + name: ${{ inputs.fastlane_command }}${{inputs.xcresult_suffix}} |
| 96 | + path: fastlane/test_results/${{ inputs.fastlane_command }}.xcresult |
| 97 | + |
| 98 | + - name: Archiving Raw Test Logs |
| 99 | + uses: actions/upload-artifact@v4 |
| 100 | + if: ${{ failure() || cancelled() }} |
| 101 | + with: |
| 102 | + name: ${{ inputs.fastlane_command }}${{inputs.xcresult_suffix}}_raw_output |
| 103 | + path: | |
| 104 | + ~/Library/Logs/scan/*.log |
| 105 | + ./fastlane/test_output/** |
| 106 | +
|
| 107 | + - name: Store screenshot |
| 108 | + uses: ./.github/actions/capture-screenshot |
| 109 | + if: failure() |
0 commit comments