32
32
with :
33
33
all_but_latest : true
34
34
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
45
36
- uses : actions/setup-node@v2
46
37
with :
47
38
node-version : 14
@@ -50,54 +41,39 @@ jobs:
50
41
with :
51
42
xcode-version : latest-stable
52
43
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
67
45
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
74
47
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)"
78
55
79
56
- uses : actions/cache@v2
80
57
name : Yarn Cache
81
58
id : yarn-cache
82
59
with :
83
- path : ${{ steps.yarn-cache-dir-path .outputs.dir }}
60
+ path : ${{ steps.workflow-variables .outputs.yarn-cache- dir }}
84
61
key : ${{ runner.os }}-yarn-v1-${{ hashFiles('**/package.json') }}
85
62
restore-keys : ${{ runner.os }}-yarn-v1
86
63
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
-
95
64
- uses : actions/cache@v2
96
65
name : Detox Framework Cache
97
66
id : detox-cache
98
67
with :
99
68
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
101
77
102
78
- name : Yarn Install
103
79
uses : nick-invision/retry@v2
@@ -110,39 +86,71 @@ jobs:
110
86
- name : Update Ruby build tools
111
87
uses : nick-invision/retry@v2
112
88
with :
113
- timeout_minutes : 10
89
+ timeout_minutes : 2
114
90
retry_wait_seconds : 60
115
91
max_attempts : 3
116
92
command : gem update cocoapods xcodeproj
117
93
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
+
118
102
- name : Pod Install
119
103
uses : nick-invision/retry@v2
120
104
with :
121
- timeout_minutes : 10
105
+ timeout_minutes : 2
122
106
retry_wait_seconds : 60
123
107
max_attempts : 3
124
108
command : yarn tests:ios:pod:install
125
109
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
+
126
120
- name : Build iOS App
127
121
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
128
128
export SKIP_BUNDLING=1
129
129
export RCT_NO_LAUNCH_PACKAGER=1
130
130
cd tests
131
131
set -o pipefail
132
132
./node_modules/.bin/detox build --configuration ios.sim.debug
133
+ ccache -s
133
134
shell : bash
134
135
135
136
- name : Install applesimutils
136
137
uses : nick-invision/retry@v2
137
138
with :
138
- timeout_minutes : 10
139
+ timeout_minutes : 5
139
140
retry_wait_seconds : 60
140
141
max_attempts : 3
141
142
command : HOMEBREW_NO_AUTO_UPDATE=1 brew tap wix/brew && HOMEBREW_NO_AUTO_UPDATE=1 brew install applesimutils && applesimutils --list
142
143
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
+
143
151
- name : Pre-fetch Javascript bundle
144
152
run : |
145
- nohup yarn tests:packager:jet &
153
+ nohup yarn tests:packager:jet-ci &
146
154
printf 'Waiting for packager to come online'
147
155
until curl --output /dev/null --silent --head --fail http://localhost:8081/status; do
148
156
printf '.'
@@ -159,18 +167,11 @@ jobs:
159
167
run : nohup sh -c "sleep 30 && xcrun simctl spawn booted log stream --level debug --style compact > simulator.log 2>&1 &"
160
168
161
169
- name : Detox Test
162
- timeout-minutes : 40
170
+ timeout-minutes : 10
163
171
run : |
164
172
cd tests
165
173
./node_modules/.bin/nyc ./node_modules/.bin/detox test --debug-synchronization 200 --configuration ios.sim.debug
166
174
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
-
174
175
- name : Compress Simulator Log
175
176
if : always()
176
177
run : gzip -9 simulator.log
0 commit comments