Skip to content

Commit

Permalink
ci/cd: clear cache
Browse files Browse the repository at this point in the history
  • Loading branch information
bang9 committed Mar 24, 2023
1 parent d041930 commit ada3ec6
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
### Aliases
aliases:
- &restore_node_modules_base
key: yarn-base-{{ arch }}-{{ checksum "yarn.lock" }}-v2
key: v{{ .Environment.CACHE_VERSION }}-yarn-base-{{ arch }}-{{ checksum "yarn.lock" }}
- &restore_node_modules_packages
key: yarn-packages-{{ arch }}-{{ checksum "yarn.lock" }}-v2
key: v{{ .Environment.CACHE_VERSION }}-yarn-packages-{{ arch }}-{{ checksum "yarn.lock" }}
- &install_node_modules
name: Install node_modules
command: yarn install --frozen-lockfiles
- &save_node_modules_base
key: yarn-base-{{ arch }}-{{ checksum "yarn.lock" }}-v2
key: v{{ .Environment.CACHE_VERSION }}-yarn-base-{{ arch }}-{{ checksum "yarn.lock" }}
paths:
- ~/.cache/yarn
- node_modules
- &save_node_modules_packages
key: yarn-packages-{{ arch }}-{{ checksum "yarn.lock" }}-v2
key: v{{ .Environment.CACHE_VERSION }}-yarn-packages-{{ arch }}-{{ checksum "yarn.lock" }}
paths:
- sample/node_modules
- packages/uikit-chat-hooks/node_modules
Expand All @@ -25,9 +25,12 @@ aliases:
command: echo "export const APP_ID = '${SENDBIRD_APP_ID}';" >> sample/src/env.ts

### Circle CI
# https://circleci.com/docs/2.0/env-vars/#built-in-environment-variables
# https://circleci.com/docs/2.0/testing-ios/#supported-xcode-versions
# Built-in env vars - https://circleci.com/docs/2.0/env-vars/#built-in-environment-variables
# Xcode versions - https://circleci.com/docs/2.0/testing-ios/#supported-xcode-versions
# Cache key template - https://circleci.com/docs/caching/#using-keys-and-templates
version: 2.1
env:
CACHE_VERSION: 2
orbs:
ruby: circleci/[email protected]
macos: circleci/macos@2
Expand All @@ -48,21 +51,21 @@ jobs:
- macos/switch-ruby:
version: '2.7.6'
- ruby/install-deps:
key: gems-ios
key: v{{ .Environment.CACHE_VERSION }}-gems-ios
app-dir: ./sample/ios
- restore_cache: *restore_node_modules_base
- restore_cache: *restore_node_modules_packages
- run: *install_node_modules
- save_cache: *save_node_modules_base
- save_cache: *save_node_modules_packages
- restore_cache:
key: pods-{{ arch }}-{{ checksum "sample/ios/Podfile.lock" }}-v2
key: v{{ .Environment.CACHE_VERSION }}-pods-{{ arch }}-{{ checksum "sample/ios/Podfile.lock" }}
- run:
name: Install pods
working_directory: sample/ios
command: bundle exec pod install
- save_cache:
key: pods-{{ arch }}-{{ checksum "sample/ios/Podfile.lock" }}-v2
key: v{{ .Environment.CACHE_VERSION }}-pods-{{ arch }}-{{ checksum "sample/ios/Podfile.lock" }}
paths:
- sample/ios/Pods
- run: *create_app_env
Expand Down

0 comments on commit ada3ec6

Please sign in to comment.