Repository navigation
fix(text): set async thread flags for text filters #5
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: Interaction Tests | |
| on: | |
| workflow_call: | |
| inputs: | |
| ref: | |
| required: true | |
| type: string | |
| platform: | |
| default: all | |
| type: string | |
| configuration: | |
| default: default | |
| type: string | |
| update_reference: | |
| default: false | |
| type: boolean | |
| only-testing: | |
| default: '' | |
| type: string | |
| outputs: | |
| verified-sha: | |
| description: Commit verified on both platforms | |
| value: ${{ jobs.ios_interaction_test.outputs.sha == jobs.macos_interaction_test.outputs.sha && jobs.ios_interaction_test.outputs.sha || '' }} | |
| workflow_dispatch: | |
| inputs: | |
| platform: | |
| description: Platform to test | |
| required: true | |
| default: all | |
| type: choice | |
| options: | |
| - all | |
| - ios | |
| - macos | |
| update_reference: | |
| description: Update reference images before running interaction tests | |
| required: false | |
| default: false | |
| type: boolean | |
| only-testing: | |
| description: 'Optional test identifier (e.g. OpenSwiftUIInteractionTests/TapGestureInteractionTests)' | |
| required: false | |
| default: '' | |
| type: string | |
| configuration: | |
| description: interaction test configuration set | |
| required: false | |
| default: default | |
| type: choice | |
| options: | |
| - default | |
| - all | |
| - swiftui-renderer-ag | |
| - swiftui-renderer-iag | |
| - openswiftui-renderer-ag | |
| - openswiftui-renderer-iag | |
| issue_comment: | |
| types: [created] | |
| permissions: | |
| contents: read | |
| issues: read | |
| pull-requests: read | |
| statuses: write | |
| jobs: | |
| prepare_interaction_tests: | |
| uses: ./.github/workflows/prepare_snapshot_tests.yml | |
| with: | |
| command: /interactiontest | |
| status-context-prefix: Interaction Tests | |
| ref: ${{ inputs.ref || '' }} | |
| platform: ${{ inputs.platform || 'all' }} | |
| configuration: ${{ inputs.configuration || 'default' }} | |
| update_reference: ${{ inputs.update_reference || false }} | |
| only-testing: ${{ inputs.only-testing || '' }} | |
| ios_interaction_test: | |
| name: Execute interaction tests on iOS (${{ matrix.configuration.id }}) | |
| outputs: | |
| sha: ${{ steps.run-tests.outputs.test-result == 'success' && needs.prepare_interaction_tests.outputs.only-testing == '' && steps.checkout.outputs.commit || '' }} | |
| needs: prepare_interaction_tests | |
| permissions: | |
| contents: read | |
| issues: read | |
| pull-requests: read | |
| statuses: write | |
| id-token: write | |
| if: >- | |
| needs.prepare_interaction_tests.outputs.ios-requested == 'true' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| xcode-version: ["26.6"] | |
| release: [2024] | |
| ios-version: ["18.5"] | |
| configuration: ${{ fromJSON(needs.prepare_interaction_tests.outputs.configuration-matrix) }} | |
| include: | |
| - ios-version: "18.5" | |
| ios-simulator-name: "iPhone 16 Pro" | |
| timeout-minutes: 90 | |
| runs-on: | |
| - xcode-26.6 | |
| - ios-simulator-18.5 | |
| env: | |
| STATUS_CONTEXT: Interaction Tests / iOS / ${{ matrix.configuration.id }}${{ needs.prepare_interaction_tests.outputs.only-testing != '' && ' / Selected' || '' }} | |
| STATUS_ENABLED: ${{ needs.prepare_interaction_tests.outputs.status-enabled }} | |
| STATUS_SHA: ${{ needs.prepare_interaction_tests.outputs.ref }} | |
| CONFIGURATION_NAME: ${{ matrix.configuration.id }} | |
| OPENSWIFTUI_WERROR: 0 # Disable it to avoid enable OAG's werror and hit conflicts | |
| OPENSWIFTUI_OPENATTRIBUTESHIMS_ATTRIBUTEGRAPH: ${{ matrix.configuration.attributegraph }} | |
| OPENSWIFTUI_OPENATTRIBUTESHIMS_COMPUTE: ${{ matrix.configuration.compute }} | |
| OPENSWIFTUI_COMPATIBILITY_TEST: 0 | |
| OPENSWIFTUI_SWIFT_LOG: 0 | |
| OPENSWIFTUI_SWIFT_CRYPTO: 0 | |
| OPENSWIFTUI_TARGET_RELEASE: ${{ matrix.release }} | |
| OPENSWIFTUI_USE_LOCAL_DEPS: 1 | |
| OPENSWIFTUI_LINK_TESTING: 0 | |
| OPENSWIFTUI_SWIFTUI_RENDERER: ${{ matrix.configuration.swiftui_renderer }} | |
| GH_TOKEN: ${{ github.token }} | |
| steps: | |
| - name: Mark PR status running | |
| if: github.event_name == 'issue_comment' && env.STATUS_ENABLED == 'true' && env.STATUS_SHA != '' | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const { owner, repo } = context.repo; | |
| await github.rest.repos.createCommitStatus({ | |
| owner, | |
| repo, | |
| sha: process.env.STATUS_SHA, | |
| state: "pending", | |
| target_url: `${process.env.GITHUB_SERVER_URL}/${owner}/${repo}/actions/runs/${context.runId}`, | |
| description: `iOS interaction tests (${process.env.CONFIGURATION_NAME}) are running.`, | |
| context: process.env.STATUS_CONTEXT, | |
| }); | |
| - uses: actions/checkout@v4 | |
| id: checkout | |
| with: | |
| repository: ${{ needs.prepare_interaction_tests.outputs.repository || github.repository }} | |
| ref: ${{ needs.prepare_interaction_tests.outputs.ref || github.sha }} | |
| persist-credentials: false | |
| - name: Run Interaction Tests | |
| id: run-tests | |
| uses: ./.github/actions/interactiontests | |
| with: | |
| xcode-version: ${{ matrix.xcode-version }} | |
| platform: ios | |
| destination: "platform=iOS Simulator,OS=${{ matrix.ios-version }},name=${{ matrix.ios-simulator-name }}" | |
| artifact-name: ios-interactiontest-snapshots-${{ matrix.ios-version }}-${{ matrix.configuration.id }} | |
| update-reference: ${{ needs.prepare_interaction_tests.outputs.update-reference == 'true' }} | |
| only-testing: ${{ needs.prepare_interaction_tests.outputs.only-testing }} | |
| compute: ${{ matrix.configuration.compute == 1 }} | |
| - name: Require successful tests | |
| if: steps.run-tests.outputs.test-result != 'success' | |
| run: exit 1 | |
| - name: Complete PR status | |
| if: always() && github.event_name == 'issue_comment' && env.STATUS_ENABLED == 'true' && env.STATUS_SHA != '' | |
| uses: actions/github-script@v7 | |
| env: | |
| JOB_STATUS: ${{ job.status }} | |
| with: | |
| script: | | |
| const { owner, repo } = context.repo; | |
| const state = process.env.JOB_STATUS === "success" ? "success" : | |
| process.env.JOB_STATUS === "cancelled" ? "error" : | |
| "failure"; | |
| const description = process.env.JOB_STATUS === "cancelled" ? | |
| "iOS interaction tests were cancelled." : | |
| `iOS interaction tests (${process.env.CONFIGURATION_NAME}) completed with ${state}.`; | |
| await github.rest.repos.createCommitStatus({ | |
| owner, | |
| repo, | |
| sha: process.env.STATUS_SHA, | |
| state, | |
| target_url: `${process.env.GITHUB_SERVER_URL}/${owner}/${repo}/actions/runs/${context.runId}`, | |
| description, | |
| context: process.env.STATUS_CONTEXT, | |
| }); | |
| macos_interaction_test: | |
| name: Execute interaction tests on macOS (${{ matrix.configuration.id }}) | |
| outputs: | |
| sha: ${{ steps.run-tests.outputs.test-result == 'success' && needs.prepare_interaction_tests.outputs.only-testing == '' && steps.checkout.outputs.commit || '' }} | |
| needs: prepare_interaction_tests | |
| permissions: | |
| contents: read | |
| issues: read | |
| pull-requests: read | |
| statuses: write | |
| id-token: write | |
| if: >- | |
| needs.prepare_interaction_tests.outputs.macos-requested == 'true' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [macos-15] | |
| xcode-version: ["26.6"] | |
| release: [2024] | |
| configuration: ${{ fromJSON(needs.prepare_interaction_tests.outputs.configuration-matrix) }} | |
| timeout-minutes: 90 | |
| runs-on: | |
| - self-hosted | |
| - ${{ matrix.os }} | |
| - xcode-26.6 | |
| env: | |
| STATUS_CONTEXT: Interaction Tests / macOS / ${{ matrix.configuration.id }}${{ needs.prepare_interaction_tests.outputs.only-testing != '' && ' / Selected' || '' }} | |
| STATUS_ENABLED: ${{ needs.prepare_interaction_tests.outputs.status-enabled }} | |
| STATUS_SHA: ${{ needs.prepare_interaction_tests.outputs.ref }} | |
| CONFIGURATION_NAME: ${{ matrix.configuration.id }} | |
| OPENSWIFTUI_WERROR: 0 | |
| OPENSWIFTUI_OPENATTRIBUTESHIMS_ATTRIBUTEGRAPH: ${{ matrix.configuration.attributegraph }} | |
| OPENSWIFTUI_OPENATTRIBUTESHIMS_COMPUTE: ${{ matrix.configuration.compute }} | |
| OPENSWIFTUI_COMPATIBILITY_TEST: 0 | |
| OPENSWIFTUI_SWIFT_LOG: 0 | |
| OPENSWIFTUI_SWIFT_CRYPTO: 0 | |
| OPENSWIFTUI_TARGET_RELEASE: ${{ matrix.release }} | |
| OPENSWIFTUI_USE_LOCAL_DEPS: 1 | |
| OPENSWIFTUI_LINK_TESTING: 0 | |
| OPENSWIFTUI_SWIFTUI_RENDERER: ${{ matrix.configuration.swiftui_renderer }} | |
| GH_TOKEN: ${{ github.token }} | |
| steps: | |
| - name: Mark PR status running | |
| if: github.event_name == 'issue_comment' && env.STATUS_ENABLED == 'true' && env.STATUS_SHA != '' | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const { owner, repo } = context.repo; | |
| await github.rest.repos.createCommitStatus({ | |
| owner, | |
| repo, | |
| sha: process.env.STATUS_SHA, | |
| state: "pending", | |
| target_url: `${process.env.GITHUB_SERVER_URL}/${owner}/${repo}/actions/runs/${context.runId}`, | |
| description: `macOS interaction tests (${process.env.CONFIGURATION_NAME}) are running.`, | |
| context: process.env.STATUS_CONTEXT, | |
| }); | |
| - uses: actions/checkout@v4 | |
| id: checkout | |
| with: | |
| repository: ${{ needs.prepare_interaction_tests.outputs.repository || github.repository }} | |
| ref: ${{ needs.prepare_interaction_tests.outputs.ref || github.sha }} | |
| persist-credentials: false | |
| - name: Run Interaction Tests | |
| id: run-tests | |
| uses: ./.github/actions/interactiontests | |
| with: | |
| xcode-version: ${{ matrix.xcode-version }} | |
| platform: macos | |
| destination: "platform=macOS" | |
| artifact-name: macos-interactiontest-snapshots-${{ matrix.configuration.id }} | |
| update-reference: ${{ needs.prepare_interaction_tests.outputs.update-reference == 'true' }} | |
| only-testing: ${{ needs.prepare_interaction_tests.outputs.only-testing }} | |
| compute: ${{ matrix.configuration.compute == 1 }} | |
| - name: Require successful tests | |
| if: steps.run-tests.outputs.test-result != 'success' | |
| run: exit 1 | |
| - name: Complete PR status | |
| if: always() && github.event_name == 'issue_comment' && env.STATUS_ENABLED == 'true' && env.STATUS_SHA != '' | |
| uses: actions/github-script@v7 | |
| env: | |
| JOB_STATUS: ${{ job.status }} | |
| with: | |
| script: | | |
| const { owner, repo } = context.repo; | |
| const state = process.env.JOB_STATUS === "success" ? "success" : | |
| process.env.JOB_STATUS === "cancelled" ? "error" : | |
| "failure"; | |
| const description = process.env.JOB_STATUS === "cancelled" ? | |
| "macOS interaction tests were cancelled." : | |
| `macOS interaction tests (${process.env.CONFIGURATION_NAME}) completed with ${state}.`; | |
| await github.rest.repos.createCommitStatus({ | |
| owner, | |
| repo, | |
| sha: process.env.STATUS_SHA, | |
| state, | |
| target_url: `${process.env.GITHUB_SERVER_URL}/${owner}/${repo}/actions/runs/${context.runId}`, | |
| description, | |
| context: process.env.STATUS_CONTEXT, | |
| }); |