Try caching built iOS app
This commit is contained in:
parent
e509a7a6e8
commit
b679c6894f
|
@ -25,10 +25,9 @@ commands:
|
||||||
type: string
|
type: string
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- attach_workspace:
|
|
||||||
at: .
|
|
||||||
- restore-npm-cache-mac
|
- restore-npm-cache-mac
|
||||||
- restore-brew-cache
|
- restore-brew-cache
|
||||||
|
- restore-app-cache
|
||||||
- install-node
|
- install-node
|
||||||
- install-apple-sim-utils
|
- install-apple-sim-utils
|
||||||
- install-npm-modules
|
- install-npm-modules
|
||||||
|
@ -159,6 +158,42 @@ commands:
|
||||||
npx detox clean-framework-cache
|
npx detox clean-framework-cache
|
||||||
npx detox build-framework-cache
|
npx detox build-framework-cache
|
||||||
|
|
||||||
|
save-app-cache:
|
||||||
|
description: Restore previously built app
|
||||||
|
steps:
|
||||||
|
- run:
|
||||||
|
name: Generate cache key for app source
|
||||||
|
command: |
|
||||||
|
echo $(git rev-parse HEAD:app) > "./app-git-revision.txt"
|
||||||
|
- save_cache:
|
||||||
|
key: iOSDetoxRelease-{{ checksum "yarn.lock" }}-{{ checksum "ios/Podfile.lock" }}-{{ checksum "./app-git-revision.txt" }}
|
||||||
|
paths:
|
||||||
|
- ios/build/Build/Products/Release-iphonesimulator/RocketChatRN.app
|
||||||
|
|
||||||
|
restore-app-cache:
|
||||||
|
description: Save built app to cache
|
||||||
|
steps:
|
||||||
|
- run:
|
||||||
|
name: Generate cache key for app source
|
||||||
|
command: |
|
||||||
|
echo $(git rev-parse HEAD:app) > "./app-git-revision.txt"
|
||||||
|
- restore_cache:
|
||||||
|
key: iOSDetoxRelease-{{ checksum "yarn.lock" }}-{{ checksum "ios/Podfile.lock" }}-{{ checksum "./app-git-revision.txt" }}
|
||||||
|
|
||||||
|
did-restore-app-cache:
|
||||||
|
description: Tests to see if an app was restored from the restore-app-cache job
|
||||||
|
steps:
|
||||||
|
- run:
|
||||||
|
name: if cache exists exit
|
||||||
|
command: |
|
||||||
|
FILE=/Users/distiller/project/ios/build/Build/Products/Release-iphonesimulator/RocketChatRN.app
|
||||||
|
if test -f "$FILE"; then
|
||||||
|
echo "App restored from cache. Halting build."
|
||||||
|
circleci step halt
|
||||||
|
else
|
||||||
|
echo "Suitable app not cached. Continuing build."
|
||||||
|
fi
|
||||||
|
|
||||||
# JOBS
|
# JOBS
|
||||||
jobs:
|
jobs:
|
||||||
lint-testunit:
|
lint-testunit:
|
||||||
|
@ -200,6 +235,10 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
|
|
||||||
|
- restore-app-cache
|
||||||
|
|
||||||
|
- did-restore-app-cache
|
||||||
|
|
||||||
- restore-npm-cache-mac
|
- restore-npm-cache-mac
|
||||||
|
|
||||||
- restore-brew-cache
|
- restore-brew-cache
|
||||||
|
@ -217,15 +256,11 @@ jobs:
|
||||||
command: |
|
command: |
|
||||||
npx detox build --configuration ios.sim.release
|
npx detox build --configuration ios.sim.release
|
||||||
|
|
||||||
- persist_to_workspace:
|
|
||||||
root: .
|
|
||||||
paths:
|
|
||||||
- ios/build/Build/Products/Release-iphonesimulator/RocketChatRN.app
|
|
||||||
|
|
||||||
- save-npm-cache-mac
|
- save-npm-cache-mac
|
||||||
|
|
||||||
- save-brew-cache
|
- save-brew-cache
|
||||||
|
|
||||||
|
- save-app-cache
|
||||||
|
|
||||||
e2e-test-onboarding:
|
e2e-test-onboarding:
|
||||||
executor: mac-env
|
executor: mac-env
|
||||||
|
|
Loading…
Reference in New Issue