25
25
timeout-minutes : ${{ inputs.timeout_minutes }}
26
26
27
27
steps :
28
+ - name : Start iOS simulator (background)
29
+ run : |
30
+ xcrun simctl boot "iPhone 15" &
31
+ shell : bash
28
32
- name : Checkout repository
29
33
uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
30
34
with :
@@ -37,21 +41,32 @@ jobs:
37
41
GH_TOKEN_STAGING_READ : ${{ secrets.GH_TOKEN_STAGING_READ }}
38
42
- name : Load Verdaccio with AmplifyJs
39
43
uses : ./amplify-js/.github/actions/load-verdaccio-with-amplify-js
44
+ - name : Cache node_modules
45
+ id : modules-cache
46
+ uses : actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
47
+ with :
48
+ path : ./node_modules
49
+ key : ${{ inputs.test_name }}-detox-modules-${{ hashFiles('yarn.lock') }}
40
50
- name : Yarn Install
51
+ if : steps.modules-cache.outputs.cache-hit != 'true'
41
52
working-directory : ${{ inputs.working_directory }}
42
53
run : |
43
54
echo "Current NPM registry: " $(yarn config get registry)
44
55
$GITHUB_WORKSPACE/amplify-js/scripts/retry-yarn-script.sh -s 'install --frozen-lockfile --non-interactive' -n 3
45
56
shell : bash
57
+
58
+ - name : Cache Pods
59
+ uses : actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
60
+ id : pods-cache
61
+ with :
62
+ path : ios/Pods
63
+ key : ${{ inputs.test_name }}-pods-${{ hashFiles('ios/Podfile.lock') }}
46
64
- name : Install CocoaPods
65
+ if : steps.pods-cache.outputs.cache-hit != 'true' || steps.modules-cache.outputs.cache-hit != 'true'
47
66
run : |
48
67
cd ios && pod install
49
68
working-directory : ${{ inputs.working_directory }}
50
69
shell : bash
51
- - name : Start iOS simulator (background)
52
- run : |
53
- xcrun simctl boot "iPhone 15" &
54
- shell : bash
55
70
- name : Start Metro Packager (background)
56
71
run : |
57
72
yarn start &
66
81
yarn global add detox-cli
67
82
working-directory : ${{ inputs.working_directory }}
68
83
shell : bash
84
+ - name : Cache Detox build
85
+ id : cache-detox-build
86
+ uses : actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
87
+ with :
88
+ path : ios/build
89
+ key : ${{ inputs.test_name }}-detox-build
90
+
69
91
- name : Detox Build
92
+ if : steps.cache-detox-build.outputs.cache-hit != 'true' || steps.modules-cache.outputs.cache-hit != 'true' || steps.pods-cache.outputs.cache-hit != 'true'
70
93
run : |
71
94
detox build -c ios.sim.debug
72
95
env :
0 commit comments