Skip to content

Commit

Permalink
Try bringing in the yarn install from the orb for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
joshdholtz committed Jan 3, 2022
1 parent 60735a0 commit 958892f
Showing 1 changed file with 46 additions and 3 deletions.
49 changes: 46 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,49 @@ version: 2.1
orbs:
rn: react-native-community/[email protected]
commands:
rc_yarn_install:
parameters:
path:
description: Path to run yarn install
type: string
default: "./"
cache:
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"
cache_key:
description: A key when cache needs to go
type: string
default: "v1"

steps:
- when:
condition: <<parameters.cache>>
steps:
- run:
name: Create cache checksum file
command: |
mkdir -p ~/.tmp/checksumfiles
find . -type f -name 'package.json' -not -path "*node_modules*" -exec cat {} + >> ~/.tmp/checksumfiles/package.json
find . -type f -name 'yarn.lock' -not -path "*node_modules*" -exec cat {} + >> ~/.tmp/checksumfiles/yarn.lock
- restore_cache:
keys:
- yarn-cache-<<parameters.cache_key>>-{{ arch }}-{{ checksum "~/.tmp/checksumfiles/package.json" }}-{{ checksum "~/.tmp/checksumfiles/yarn.lock" }}-{{ .Environment.CACHE_VERSION }}
- run:
name: Yarn Install
command: "yarn install --cwd <<parameters.path>> --frozen-lockfile --non-interactive --cache-folder <<parameters.cache_folder>>"
- when:
condition: <<parameters.cache>>
steps:
- save_cache:
paths:
- <<parameters.cache_folder>>
key: |
yarn-cache-{{ arch }}-{{ checksum "~/.tmp/checksumfiles/package.json" }}-{{ checksum "~/.tmp/checksumfiles/yarn.lock" }}-{{ .Environment.CACHE_VERSION }}
yarn_install_example:
steps:
- run:
Expand Down Expand Up @@ -78,8 +121,6 @@ jobs:
steps:
- checkout
- yarn_install_example
- rn/android_build:
project_path: examples/purchaseTester/android
- rn/android_build:
project_path: examples/purchaseTesterTypescript/android
ios:
Expand All @@ -90,8 +131,10 @@ jobs:
- checkout
- rn/ios_simulator_start:
device: iPhone 11 Pro
- yarn_install_example
#- yarn_install_example
#- rn/yarn_install
- rc_yarn_install:
path: examples/purchaseTesterTypescript
- install_pods
- rn/ios_build:
build_configuration: Release
Expand Down

0 comments on commit 958892f

Please sign in to comment.