-
Notifications
You must be signed in to change notification settings - Fork 236
139 lines (128 loc) · 5.69 KB
/
Copy pathrun_integration_tests.yml
File metadata and controls
139 lines (128 loc) · 5.69 KB
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
name: Run tests for the given parameters
on:
workflow_call:
inputs:
os-runner:
type: string
default: 'macos-26'
scheme:
description: 'The scheme to run the tests'
required: true
type: string
platform:
description: 'The platform in which to run these tests'
required: true
type: string
project_path:
required: false
type: string
xcode_version:
description: 'The version of Xcode used to run these tests'
default: 'latest'
type: string
destination:
default: ''
type: string
resource_subfolder:
required: true
type: string
timeout-minutes:
description: 'The timeout for each execution'
required: false
type: number
default: 60
permissions:
id-token: write
contents: read
jobs:
integration-tests:
name: ${{ inputs.platform }} Tests | ${{ inputs.scheme }}
runs-on: ${{ inputs.os-runner }}
if: inputs.platform != 'macOS' # macOS is not supported for Integration Tests
timeout-minutes: ${{ inputs.timeout-minutes }}
environment: IntegrationTest
steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
with:
persist-credentials: false
- name: Get build parameters for ${{ inputs.platform}}
id: platform
uses: ./.github/composite_actions/get_platform_parameters
with:
platform: ${{ inputs.platform }}
xcode_version: ${{ inputs.xcode_version }}
destination: ${{ inputs.destination }}
- name: Install simulators if needed
uses: ./.github/composite_actions/install_simulators_if_needed
with:
xcode_version: ${{ steps.platform.outputs.xcode-version }}
platform: ${{ inputs.platform }}
- name: Create the test configuration directory
run: mkdir -p ~/.aws-amplify/amplify-ios/testconfiguration/
- name: Download the Integration Test configurations
uses: ./.github/composite_actions/download_test_configuration
with:
resource_subfolder: ${{ inputs.resource_subfolder }}
aws_role_to_assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
aws_region: ${{ secrets.AWS_REGION }}
aws_s3_bucket: ${{ secrets.AWS_S3_BUCKET_INTEG_V2 }}
destination: ~/.aws-amplify/amplify-ios/testconfiguration/
- name: Attempt to use the dependencies cache
id: dependencies-cache
timeout-minutes: 4
continue-on-error: true
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: ~/Library/Developer/Xcode/DerivedData/Amplify
key: amplify-packages-${{ steps.platform.outputs.xcode-version }}-${{ hashFiles('Package.resolved') }}
restore-keys: |
amplify-packages-${{ steps.platform.outputs.xcode-version }}-
- name: Attempt to restore the build cache
id: build-cache
if: steps.dependencies-cache.outputs.cache-hit
timeout-minutes: 4
continue-on-error: true
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: ${{ github.workspace }}/Build
key: Amplify-${{ inputs.platform }}-${{ steps.platform.outputs.xcode-version }}-${{ inputs.scheme }}-build-cache-${{ hashFiles('Package.resolved') }}
- name: Run ${{ inputs.platform }} Integration Tests
id: run-tests
continue-on-error: true
uses: ./.github/composite_actions/run_xcodebuild_test
with:
scheme: ${{ inputs.scheme }}
destination: ${{ steps.platform.outputs.destination }}
sdk: ${{ steps.platform.outputs.sdk }}
xcode_path: /Applications/Xcode_${{ steps.platform.outputs.xcode-version }}.app
project_path: ${{ inputs.project_path }}
generate_coverage: false
cloned_source_packages_path: ~/Library/Developer/Xcode/DerivedData/Amplify
derived_data_path: ${{ github.workspace }}/Build
disable_package_resolution: ${{ steps.dependencies-cache.outputs.cache-hit }}
test_without_building: false
other_flags: -test-iterations 3 -retry-tests-on-failure -parallel-testing-enabled NO -test-repetition-relaunch-enabled YES
- name: Retry ${{ inputs.platform }} Integration Tests
if: steps.run-tests.outcome=='failure'
id: retry-tests
uses: ./.github/composite_actions/run_xcodebuild_test
with:
scheme: ${{ inputs.scheme }}
destination: ${{ steps.platform.outputs.destination }}
sdk: ${{ steps.platform.outputs.sdk }}
xcode_path: /Applications/Xcode_${{ steps.platform.outputs.xcode-version }}.app
project_path: ${{ inputs.project_path }}
generate_coverage: false
cloned_source_packages_path: ~/Library/Developer/Xcode/DerivedData/Amplify
derived_data_path: ${{ github.workspace }}/Build
disable_package_resolution: true
# Only attempt to test without building when we are not using any cache.
test_without_building: ${{ !steps.build-cache.outputs.cache-hit }}
other_flags: -test-iterations 3 -retry-tests-on-failure -parallel-testing-enabled NO -test-repetition-relaunch-enabled YES
- name: Save the build cache
if: steps.build-cache.outputs.cache-hit != 'true' && (steps.run-tests.outcome == 'success' || steps.retry-tests.outcome == 'success')
uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: ${{ github.workspace }}/Build
key: ${{ steps.build-cache.outputs.cache-primary-key }}