Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make yarn cache folder configurable #103

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/commands/yarn_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ parameters:
description: Save and restore the build cache? Defaults to true
type: boolean
default: true
cache_folder:
description: The path to the yarn cache folder. Defaults to /tmp/yarn
type: string
default: "/tmp/yarn"

steps:
- when:
Expand All @@ -21,12 +25,12 @@ steps:
- yarn-cache-{{ arch }}-{{ checksum "~/.tmp/checksumfiles/package.json" }}-{{ checksum "~/.tmp/checksumfiles/yarn.lock" }}-{{ .Environment.CACHE_VERSION }}
- run:
name: Yarn Install
command: yarn install --frozen-lockfile --non-interactive --cache-folder /tmp/yarn
command: "yarn install --frozen-lockfile --non-interactive --cache-folder <<parameters.cache_folder>>"
- when:
condition: <<parameters.cache>>
steps:
- save_cache:
paths:
- /tmp/yarn
- <<parameters.cache_folder>>
key: |
yarn-cache-{{ arch }}-{{ checksum "~/.tmp/checksumfiles/package.json" }}-{{ checksum "~/.tmp/checksumfiles/yarn.lock" }}-{{ .Environment.CACHE_VERSION }}
5 changes: 5 additions & 0 deletions src/jobs/ios_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ parameters:
description: Should we cache after yarn install? Defaults to true
type: boolean
default: true
yarn_cache_folder:
description: The path to the yarn cache folder
type: string
default: "/tmp/yarn"
# For the iOS build command
project_type:
description: If the iOS app is built using a project file (*.xcodeproj) or a workspace.
Expand Down Expand Up @@ -81,6 +85,7 @@ steps:
homebrew_cache: <<parameters.homebrew_cache>>
- yarn_install:
cache: <<parameters.yarn_cache>>
cache_folder: <<parameters.yarn_cache_folder>>
- when:
condition: <<parameters.on_after_initialize>>
steps:
Expand Down
5 changes: 5 additions & 0 deletions src/jobs/ios_build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ parameters:
description: Should we cache after yarn install? Defaults to true
type: boolean
default: true
yarn_cache_folder:
description: The path to the yarn cache folder
type: string
default: "/tmp/yarn"
# For the iOS build command
project_type:
description: If the iOS app is built using a project file (*.xcodeproj) or a workspace.
Expand Down Expand Up @@ -101,6 +105,7 @@ steps:
device: <<parameters.device>>
- yarn_install:
cache: <<parameters.yarn_cache>>
cache_folder: <<parameters.yarn_cache_folder>>
- when:
condition: <<parameters.on_after_initialize>>
steps:
Expand Down