name: ios-device-test on: workflow_run: workflows: [ios-ci] types: - completed permissions: id-token: write # needed for AWS jobs: ios-device-test: strategy: matrix: test: [ {artifactName: ios-render-test, xcTestFile: RenderTest.xctest.zip, ipaFile: RenderTestApp.ipa, name: "iOS Render Tests"}, {artifactName: ios-cpp-unit-tests, xcTestFile: CppUnitTests.xctest.zip, ipaFile: CppUnitTestsApp.ipa, name: "iOS C++ Unit Tests"}, ] fail-fast: true runs-on: ubuntu-24.04 if: github.repository_owner == 'maplibre' && github.event.workflow_run.conclusion == 'success' steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Generate token uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 id: generate_token with: app-id: ${{ secrets.MAPLIBRE_NATIVE_BOT_APP_ID }} private-key: ${{ secrets.MAPLIBRE_NATIVE_BOT_PRIVATE_KEY }} - uses: LouisBrunner/checks-action@937cbbcde3259005b50746dc91cde29098aac2ff # v3.1.0 id: create_check with: token: ${{ steps.generate_token.outputs.token }} details_url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} status: in_progress name: ${{ matrix.test.name }} sha: ${{ github.event.workflow_run.head_sha }} - uses: ./.github/actions/download-workflow-run-artifact with: artifact-name: ${{ matrix.test.artifactName }} - name: Check if test files exist (otherwise the parent workflow was skipped) id: check_files uses: andstor/file-existence-action@558493d6c74bf472d87c84eab196434afc2fa029 # v3.1.0 with: files: "${{ matrix.test.xcTestFile }}, ${{ matrix.test.ipaFile }}" - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@e6de054238d6b7531b4efff3b6587d9aade6a06c # v6.2.3 with: aws-region: us-west-2 role-to-assume: ${{ vars.OIDC_AWS_ROLE_TO_ASSUME }} role-session-name: ${{ github.run_id }} role-duration-seconds: 14400 - name: Run ${{ matrix.test.name }} on AWS Device Farm if: steps.check_files.outputs.files_exists == 'true' run: | export name="${{ matrix.test.name }}" export appType=IOS_APP export appFile="${{ matrix.test.ipaFile }}" export testFile="${{ matrix.test.xcTestFile }}" export testPackageType=XCTEST_TEST_PACKAGE export testType=XCTEST export AWS_DEVICE_FARM_PROJECT_ARN="${{ vars.AWS_DEVICE_FARM_PROJECT_ARN }}" export AWS_DEVICE_FARM_DEVICE_POOL_ARN="${{ vars.AWS_DEVICE_FARM_IPHONE_DEVICE_POOL_ARN }}" export wait_for_completion=true ./scripts/aws-device-farm/aws-device-farm-run.sh - name: Generate another token (previous one could have expired) if: always() uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 id: generate_token_2 with: app-id: ${{ secrets.MAPLIBRE_NATIVE_BOT_APP_ID }} private-key: ${{ secrets.MAPLIBRE_NATIVE_BOT_PRIVATE_KEY }} - uses: LouisBrunner/checks-action@937cbbcde3259005b50746dc91cde29098aac2ff # v3.1.0 if: always() with: token: ${{ steps.generate_token_2.outputs.token }} check_id: ${{ steps.create_check.outputs.check_id }} conclusion: ${{ job.status }} sha: ${{ github.event.workflow_run.sha }}