Skip to content

Commit

Permalink
feat: Skip Detox setup in ios_build job
Browse files Browse the repository at this point in the history
  • Loading branch information
devnev committed Feb 4, 2022
1 parent 451e591 commit 3fc5c53
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 14 deletions.
55 changes: 43 additions & 12 deletions src/commands/setup_macos_executor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ parameters:
description: Should we run brew update? Defaults to true
type: boolean
default: true
android:
description: Should we set up the Android build environment? Defaults to true
type: boolean
default: true
detox:
description: Should we set up Detox? Defaults to true
type: boolean
default: true

steps:
- run:
Expand All @@ -27,7 +35,12 @@ steps:
source $BASH_ENV
- when:
condition: <<parameters.homebrew_cache>>
condition:
and:
- <<parameters.homebrew_cache>>
- or:
- <<parameters.android>>
- <<parameters.detox>>
steps:
- restore_cache:
key: |
Expand All @@ -50,24 +63,42 @@ steps:
command: node --version

- when:
condition: <<parameters.homebrew_update>>
condition:
and:
- <<parameters.homebrew_update>>
- or:
- <<parameters.android>>
- <<parameters.detox>>
steps:
- run:
name: Update brew
command: brew update >/dev/null

- run:
name: Configure Detox Environment
command: |
HOMEBREW_NO_AUTO_UPDATE=1 brew tap wix/brew >/dev/null
HOMEBREW_NO_AUTO_UPDATE=1 brew tap homebrew/cask >/dev/null
HOMEBREW_NO_AUTO_UPDATE=1 brew install applesimutils >/dev/null
HOMEBREW_NO_AUTO_UPDATE=1 brew install android-commandlinetools >/dev/null
touch .watchmanconfig
node -v
- when:
condition: <<parameters.android>>
steps:
run:
name: Configure Android Build Environment
command: |
HOMEBREW_NO_AUTO_UPDATE=1 brew tap homebrew/cask >/dev/null
HOMEBREW_NO_AUTO_UPDATE=1 brew install android-commandlinetools >/dev/null
- when:
condition: <<parameters.detox>>
steps:
run:
name: Configure Detox Environment
command: |
HOMEBREW_NO_AUTO_UPDATE=1 brew tap wix/brew >/dev/null
HOMEBREW_NO_AUTO_UPDATE=1 brew install applesimutils >/dev/null
- when:
condition: <<parameters.homebrew_cache>>
condition:
and:
- <<parameters.homebrew_cache>>
- or:
- <<parameters.android>>
- <<parameters.detox>>
steps:
- save_cache:
paths:
Expand Down
4 changes: 2 additions & 2 deletions src/jobs/ios_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ steps:
at: <<parameters.workspace_root>>
- setup_macos_executor:
node_version: <<parameters.node_version>>
homebrew_cache: <<parameters.homebrew_cache>>
homebrew_update: <<parameters.homebrew_update>>
android: false
detox: false
- yarn_install:
cache: <<parameters.yarn_cache>>
cache_folder: <<parameters.yarn_cache_folder>>
Expand Down
1 change: 1 addition & 0 deletions src/jobs/ios_build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ steps:
at: <<parameters.workspace_root>>
- setup_macos_executor:
node_version: <<parameters.node_version>>
android: false
homebrew_cache: <<parameters.homebrew_cache>>
homebrew_update: <<parameters.homebrew_update>>
- ios_simulator_start:
Expand Down

0 comments on commit 3fc5c53

Please sign in to comment.