-
Notifications
You must be signed in to change notification settings - Fork 251
104 lines (91 loc) · 3.63 KB
/
amplify_integration_tests.yaml
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
name: Amplify Integration Tests
on:
push:
branches: [main, next, stable, feat/*, v0]
schedule:
# 6am pacific time daily, only runs on default branch
- cron: '0 13 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
android:
runs-on: macos-latest
# These permissions are needed to interact with GitHub's OIDC Token endpoint.
permissions:
id-token: write
contents: read
strategy:
fail-fast: false
matrix:
scope:
- "amplify_analytics_pinpoint_example"
- "amplify_api_example"
- "amplify_auth_cognito_example"
- "amplify_datastore_example"
- "amplify_storage_s3_example"
steps:
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
with:
persist-credentials: false
# Flutter requires Java 11 to build android apps with Gradle.
- uses: actions/setup-java@860f60056505705214d223b91ed7a30f173f6142 # 3.3.0
with:
distribution: 'corretto' # Amazon Corretto Build of OpenJDK
java-version: '11'
- name: Install dependencies
uses: ./.github/composite_actions/install_dependencies
- name: Fetch Amplify backend configurations
uses: ./.github/composite_actions/fetch_backends
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
aws-region: ${{ secrets.AWS_REGION }}
scope: ${{ matrix.scope }}
secret-identifier: ${{ secrets.AWS_SECRET_IDENTIFIER }}
- name: Build example app with integration tests
run: |
melos exec --scope=${{ matrix.scope }} --file-exists="integration_test/main_test.dart" --fail-fast flutter build apk --verbose
- name: Run Android integration tests
uses: reactivecircus/android-emulator-runner@e790971012b979513b4e2fe70d4079bc0ca8a1ae # 2.24.0
timeout-minutes: 45
with:
# API levels 30+ too slow https://github.com/ReactiveCircus/android-emulator-runner/issues/222
api-level: 29
script: melos exec -c 1 --scope ${{ matrix.scope }} -- "deviceId=emulator-5554 retries=1 small=true \$MELOS_ROOT_PATH/build-support/integ_test_android.sh"
ios:
runs-on: macos-latest
# These permissions are needed to interact with GitHub's OIDC Token endpoint.
permissions:
id-token: write
contents: read
strategy:
fail-fast: false
matrix:
scope:
- "amplify_analytics_pinpoint_example"
- "amplify_api_example"
- "amplify_auth_cognito_example"
- "amplify_datastore_example"
- "amplify_storage_s3_example"
steps:
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # 2.4.0
with:
persist-credentials: false
- name: Install dependencies
uses: ./.github/composite_actions/install_dependencies
- name: Boot iOS Simulator
run: |
xcrun simctl boot "iPhone 13"
- name: Fetch Amplify backend configurations
uses: ./.github/composite_actions/fetch_backends
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
aws-region: ${{ secrets.AWS_REGION }}
scope: ${{ matrix.scope }}
secret-identifier: ${{ secrets.AWS_SECRET_IDENTIFIER }}
- name: Build example app with integration tests
run: |
melos exec --scope=${{ matrix.scope }} flutter build ios --simulator
- name: Run integration tests
run: |
melos exec -c 1 --scope ${{ matrix.scope }} -- "retries=1 small=true \$MELOS_ROOT_PATH/build-support/integ_test_ios.sh"