3232 with :
3333 all_but_latest : true
3434
35- - uses : actions/checkout@v2
36- with :
37- fetch-depth : 50
38-
39- - uses : mikehardy/buildcache-action@v1
40- name : Buildcache
41- with :
42- cache_key : ${{ runner.os }}-v1
43- upload_buildcache_log : true
44-
35+ # Set up tool versions
4536 - uses : actions/setup-node@v2
4637 with :
4738 node-version : 14
@@ -50,54 +41,39 @@ jobs:
5041 with :
5142 xcode-version : latest-stable
5243
53- - name : Get Xcode version
54- id : xcode-version
55- run : echo "::set-output name=xcode-version::$(xcodebuild -version|tail -1|cut -f3 -d' ')"
56-
57- - name : Install firebase CLI
58- uses : nick-invision/retry@v2
59- with :
60- timeout_minutes : 10
61- retry_wait_seconds : 60
62- max_attempts : 3
63- command : npm i -g firebase-tools
64-
65- - name : Cache Firestore Emulator
66- uses : actions/cache@v2
44+ - uses : actions/checkout@v2
6745 with :
68- path : ~/.cache/firebase/emulators
69- key : firebase-emulators-v1-${{ github.run_id }}
70- restore-keys : firebase-emulators-v1
71-
72- - name : Start Firestore Emulator
73- run : yarn tests:emulator:start-ci
46+ fetch-depth : 50
7447
75- - name : Get yarn cache directory path
76- id : yarn-cache-dir-path
77- run : echo "::set-output name=dir::$(yarn cache dir)"
48+ # Set path variables needed for caches
49+ - name : Set workflow variables
50+ id : workflow-variables
51+ run : |
52+ echo "::set-output name=metro-cache::$HOME/.metro"
53+ echo "::set-output name=xcode-version::$(xcodebuild -version|tail -1|cut -f3 -d' ')"
54+ echo "::set-output name=yarn-cache-dir::$(yarn cache dir)"
7855
7956 - uses : actions/cache@v2
8057 name : Yarn Cache
8158 id : yarn-cache
8259 with :
83- path : ${{ steps.yarn-cache-dir-path .outputs.dir }}
60+ path : ${{ steps.workflow-variables .outputs.yarn-cache- dir }}
8461 key : ${{ runner.os }}-yarn-v1-${{ hashFiles('**/package.json') }}
8562 restore-keys : ${{ runner.os }}-yarn-v1
8663
87- - uses : actions/cache@v2
88- name : Cache Pods
89- id : pods-cache
90- with :
91- path : tests/ios/Pods
92- key : ${{ runner.os }}-pods-v2-${{ hashFiles('**/Podfile.lock') }}
93- restore-keys : ${{ runner.os }}-pods-v2
94-
9564 - uses : actions/cache@v2
9665 name : Detox Framework Cache
9766 id : detox-cache
9867 with :
9968 path : ~/Library/Detox/ios
100- key : ${{ runner.os }}-detox-framework-cache-${{ steps.xcode-version.outputs.xcode-version }}
69+ key : ${{ runner.os }}-detox-framework-cache-${{ steps.workflow-variables.outputs.xcode-version }}
70+
71+ # Detox is compiled during yarn install, using Xcode, set up cache first
72+ - uses : hendrikmuhs/ccache-action@v1
73+ name : Xcode Compile Cache
74+ with :
75+ key : ${{ runner.os }}-v2 # makes a unique key w/related restore key internally
76+ max-size : 400M
10177
10278 - name : Yarn Install
10379 uses : nick-invision/retry@v2
@@ -110,39 +86,71 @@ jobs:
11086 - name : Update Ruby build tools
11187 uses : nick-invision/retry@v2
11288 with :
113- timeout_minutes : 10
89+ timeout_minutes : 2
11490 retry_wait_seconds : 60
11591 max_attempts : 3
11692 command : gem update cocoapods xcodeproj
11793
94+ - uses : actions/cache@v2
95+ name : Cache Pods
96+ id : pods-cache
97+ with :
98+ path : tests/ios/Pods
99+ key : ${{ runner.os }}-pods-v2-${{ hashFiles('**/Podfile.lock') }}
100+ restore-keys : ${{ runner.os }}-pods-v2
101+
118102 - name : Pod Install
119103 uses : nick-invision/retry@v2
120104 with :
121- timeout_minutes : 10
105+ timeout_minutes : 2
122106 retry_wait_seconds : 60
123107 max_attempts : 3
124108 command : yarn tests:ios:pod:install
125109
110+ - name : Cache Firestore Emulator
111+ uses : actions/cache@v2
112+ with :
113+ path : ~/.cache/firebase/emulators
114+ key : firebase-emulators-v1-${{ github.run_id }}
115+ restore-keys : firebase-emulators-v1
116+
117+ - name : Start Firestore Emulator
118+ run : yarn tests:emulator:start-ci
119+
126120 - name : Build iOS App
127121 run : |
122+ export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
123+ export CCACHE_SLOPPINESS=clang_index_store,file_stat_matches,include_file_ctime,include_file_mtime,ivfsoverlay,pch_defines,modules,system_headers,time_macros
124+ export CCACHE_FILECLONE=true
125+ export CCACHE_DEPEND=true
126+ export CCACHE_INODECACHE=true
127+ ccache -s
128128 export SKIP_BUNDLING=1
129129 export RCT_NO_LAUNCH_PACKAGER=1
130130 cd tests
131131 set -o pipefail
132132 ./node_modules/.bin/detox build --configuration ios.sim.debug
133+ ccache -s
133134 shell : bash
134135
135136 - name : Install applesimutils
136137 uses : nick-invision/retry@v2
137138 with :
138- timeout_minutes : 10
139+ timeout_minutes : 5
139140 retry_wait_seconds : 60
140141 max_attempts : 3
141142 command : HOMEBREW_NO_AUTO_UPDATE=1 brew tap wix/brew && HOMEBREW_NO_AUTO_UPDATE=1 brew install applesimutils && applesimutils --list
142143
144+ - name : Metro Bundler Cache
145+ uses : actions/cache@v2
146+ with :
147+ path : ${{ steps.workflow-variables.outputs.metro-cache }}
148+ key : ${{ runner.os }}-metro-v1-${{ github.run_id }}
149+ restore-keys : ${{ runner.os }}-metro-v1
150+
143151 - name : Pre-fetch Javascript bundle
144152 run : |
145- nohup yarn tests:packager:jet &
153+ nohup yarn tests:packager:jet-ci &
146154 printf 'Waiting for packager to come online'
147155 until curl --output /dev/null --silent --head --fail http://localhost:8081/status; do
148156 printf '.'
@@ -159,18 +167,11 @@ jobs:
159167 run : nohup sh -c "sleep 30 && xcrun simctl spawn booted log stream --level debug --style compact > simulator.log 2>&1 &"
160168
161169 - name : Detox Test
162- timeout-minutes : 40
170+ timeout-minutes : 10
163171 run : |
164172 cd tests
165173 ./node_modules/.bin/nyc ./node_modules/.bin/detox test --debug-synchronization 200 --configuration ios.sim.debug
166174
167- - name : Upload Buildcache Log
168- uses : actions/upload-artifact@v2
169- if : always()
170- with :
171- name : buildcache_log
172- path : ./.buildcache/buildcache.log
173-
174175 - name : Compress Simulator Log
175176 if : always()
176177 run : gzip -9 simulator.log
0 commit comments