-
Notifications
You must be signed in to change notification settings - Fork 2.2k
94 lines (91 loc) · 3.28 KB
/
callable-e2e-test-detox.yml
File metadata and controls
94 lines (91 loc) · 3.28 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
name: E2E Test - Detox
run-name: e2e-detox.${{ inputs.test_name }}
on:
workflow_call:
inputs:
test_name:
required: true
type: string
working_directory:
required: true
type: string
timeout_minutes:
required: true
type: number
host_signout_page:
required: false
type: boolean
default: false
jobs:
e2e-test:
name: E2E-Detox ${{ inputs.test_name }}
runs-on: macos-latest-large
timeout-minutes: ${{ inputs.timeout_minutes }}
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
path: amplify-js
- name: Setup node and build the repository
uses: ./amplify-js/.github/actions/node-and-build
- name: Set Xcode version
run: |
sudo xcode-select -s /Applications/Xcode_16.4.app
- name: Download iOS platform and create simulator
if: ${{ contains(inputs.test_name, 'integ_rn_ios_passkeys') }}
run: |
xcodebuild -downloadPlatform iOS -buildVersion 17.4
xcrun simctl create "iPhone 15" "com.apple.CoreSimulator.SimDeviceType.iPhone-15" "com.apple.CoreSimulator.SimRuntime.iOS-17-4"
- name: Setup samples staging repository
uses: ./amplify-js/.github/actions/setup-samples-staging
with:
GH_TOKEN_STAGING_READ: ${{ secrets.GH_TOKEN_STAGING_READ }}
- name: Load Verdaccio with AmplifyJs
uses: ./amplify-js/.github/actions/load-verdaccio-with-amplify-js
- name: Yarn Install
working-directory: ${{ inputs.working_directory }}
run: |
echo "Current NPM registry: " $(yarn config get registry)
$GITHUB_WORKSPACE/amplify-js/scripts/retry-yarn-script.sh -s 'install --frozen-lockfile --non-interactive' -n 3
shell: bash
- name: Install CocoaPods
run: |
cd ios && pod install
working-directory: ${{ inputs.working_directory }}
shell: bash
- name: Start iOS simulator (background)
run: |
xcrun simctl boot "iPhone 15" &
shell: bash
- name: Start Metro Packager (background)
run: |
yarn start &
working-directory: ${{ inputs.working_directory }}
shell: bash
- name: Configure Detox
env:
HOMEBREW_NO_AUTO_UPDATE: '1'
run: |
brew tap wix/brew
brew install applesimutils
yarn global add detox-cli
working-directory: ${{ inputs.working_directory }}
shell: bash
- name: Detox Build
run: |
detox build -c ios.sim.debug
env:
JEST_JUNIT_OUTPUT_DIR: reports/junit
JEST_JUNIT_OUTPUT_NAME: detox-test-results.xml
working-directory: ${{ inputs.working_directory }}
shell: bash
- name: Start the http-server and host the oidc signout page locally (background).
if: ${{ inputs.host_signout_page }}
run: yarn host:signout
working-directory: ${{ inputs.working_directory }}
shell: bash
- name: Detox run
run: |
$GITHUB_WORKSPACE/amplify-js/scripts/retry-yarn-script.sh -s 'detox test -c ios.sim.debug -u' -n 3
working-directory: ${{ inputs.working_directory }}
shell: bash