-
-
Notifications
You must be signed in to change notification settings - Fork 333
81 lines (70 loc) · 2.94 KB
/
ios-device-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
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-22.04
if: github.repository_owner == 'maplibre' && github.event.workflow_run.conclusion == 'success'
steps:
- uses: actions/checkout@v4
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.MAPLIBRE_NATIVE_BOT_APP_ID }}
private_key: ${{ secrets.MAPLIBRE_NATIVE_BOT_PRIVATE_KEY }}
- uses: LouisBrunner/[email protected]
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/[email protected]
with:
files: "${{ matrix.test.xcTestFile }}, ${{ matrix.test.ipaFile }}"
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
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
- uses: LouisBrunner/[email protected]
if: always()
with:
token: ${{ steps.generate_token.outputs.token }}
check_id: ${{ steps.create_check.outputs.check_id }}
conclusion: ${{ job.status }}
sha: ${{ github.event.workflow_run.sha }}