Move YAML anchors to CircleCI commands
This commit is contained in:
parent
42df5ddbc1
commit
e509a7a6e8
|
@ -8,96 +8,6 @@ macos: &macos
|
||||||
bash-env: &bash-env
|
bash-env: &bash-env
|
||||||
BASH_ENV: "~/.nvm/nvm.sh"
|
BASH_ENV: "~/.nvm/nvm.sh"
|
||||||
|
|
||||||
install-npm-modules: &install-npm-modules
|
|
||||||
name: Install NPM modules
|
|
||||||
command: yarn
|
|
||||||
|
|
||||||
restore-npm-cache-linux: &restore-npm-cache-linux
|
|
||||||
name: Restore NPM cache
|
|
||||||
key: node-modules-{{ checksum "yarn.lock" }}
|
|
||||||
|
|
||||||
save-npm-cache-linux: &save-npm-cache-linux
|
|
||||||
key: node-modules-{{ checksum "yarn.lock" }}
|
|
||||||
name: Save NPM cache
|
|
||||||
paths:
|
|
||||||
- ./node_modules
|
|
||||||
|
|
||||||
restore-npm-cache-mac: &restore-npm-cache-mac
|
|
||||||
name: Restore NPM cache
|
|
||||||
key: node-v1-mac-{{ checksum "yarn.lock" }}
|
|
||||||
|
|
||||||
save-npm-cache-mac: &save-npm-cache-mac
|
|
||||||
key: node-v1-mac-{{ checksum "yarn.lock" }}
|
|
||||||
name: Save NPM cache
|
|
||||||
paths:
|
|
||||||
- ./node_modules
|
|
||||||
|
|
||||||
install-node: &install-node
|
|
||||||
name: Install Node
|
|
||||||
command: |
|
|
||||||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
|
|
||||||
source ~/.nvm/nvm.sh
|
|
||||||
INSTALLED_NODE=`nvm which current`
|
|
||||||
echo "export PATH=\"${INSTALLED_NODE%%/node}:\$PATH\"" >> ~/.bash_profile
|
|
||||||
source ~/.bash_profile
|
|
||||||
|
|
||||||
restore-gems-cache: &restore-gems-cache
|
|
||||||
name: Restore gems cache
|
|
||||||
key: bundle-v1-{{ checksum "ios/Gemfile.lock" }}
|
|
||||||
|
|
||||||
save-gems-cache: &save-gems-cache
|
|
||||||
name: Save gems cache
|
|
||||||
key: bundle-v1-{{ checksum "ios/Gemfile.lock" }}
|
|
||||||
paths:
|
|
||||||
- vendor/bundle
|
|
||||||
|
|
||||||
update-fastlane-ios: &update-fastlane-ios
|
|
||||||
name: Update Fastlane
|
|
||||||
command: |
|
|
||||||
echo "ruby-2.6.4" > ~/.ruby-version
|
|
||||||
bundle install
|
|
||||||
working_directory: ios
|
|
||||||
|
|
||||||
update-fastlane-android: &update-fastlane-android
|
|
||||||
name: Update Fastlane
|
|
||||||
command: |
|
|
||||||
echo "ruby-2.6.4" > ~/.ruby-version
|
|
||||||
bundle install
|
|
||||||
working_directory: android
|
|
||||||
|
|
||||||
save-gradle-cache: &save-gradle-cache
|
|
||||||
name: Save gradle cache
|
|
||||||
key: android-{{ checksum "android/build.gradle" }}-{{ checksum "android/app/build.gradle" }}
|
|
||||||
paths:
|
|
||||||
- ~/.gradle
|
|
||||||
|
|
||||||
restore_cache: &restore-gradle-cache
|
|
||||||
name: Restore gradle cache
|
|
||||||
key: android-{{ checksum "android/build.gradle" }}-{{ checksum "android/app/build.gradle" }}
|
|
||||||
|
|
||||||
restore-brew-cache: &restore-brew-cache
|
|
||||||
name: Restore Brew cache
|
|
||||||
key: brew-{{ checksum "yarn.lock" }}-{{ checksum ".circleci/config.yml" }}
|
|
||||||
|
|
||||||
save-brew-cache: &save-brew-cache
|
|
||||||
name: Save brew cache
|
|
||||||
key: brew-{{ checksum "yarn.lock" }}-{{ checksum ".circleci/config.yml" }}
|
|
||||||
paths:
|
|
||||||
- /usr/local/Homebrew
|
|
||||||
|
|
||||||
install-apple-sim-utils: &install-apple-sim-utils
|
|
||||||
name: Install appleSimUtils
|
|
||||||
command: |
|
|
||||||
brew update
|
|
||||||
brew tap wix/brew
|
|
||||||
brew install wix/brew/applesimutils
|
|
||||||
|
|
||||||
rebuild-detox: &rebuild-detox
|
|
||||||
name: Rebuild Detox framework cache
|
|
||||||
command: |
|
|
||||||
npx detox clean-framework-cache
|
|
||||||
npx detox build-framework-cache
|
|
||||||
|
|
||||||
version: 2.1
|
version: 2.1
|
||||||
|
|
||||||
# EXECUTORS
|
# EXECUTORS
|
||||||
|
@ -115,27 +25,140 @@ commands:
|
||||||
type: string
|
type: string
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
|
|
||||||
- attach_workspace:
|
- attach_workspace:
|
||||||
at: .
|
at: .
|
||||||
|
- restore-npm-cache-mac
|
||||||
- restore_cache: *restore-npm-cache-mac
|
- restore-brew-cache
|
||||||
|
- install-node
|
||||||
- restore_cache: *restore-brew-cache
|
- install-apple-sim-utils
|
||||||
|
- install-npm-modules
|
||||||
- run: *install-node
|
- rebuild-detox
|
||||||
|
|
||||||
- run: *install-apple-sim-utils
|
|
||||||
|
|
||||||
- run: *install-npm-modules
|
|
||||||
|
|
||||||
- run: *rebuild-detox
|
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Test
|
name: Test
|
||||||
command: |
|
command: |
|
||||||
npx detox test << parameters.folder >> --configuration ios.sim.release --cleanup
|
npx detox test << parameters.folder >> --configuration ios.sim.release --cleanup
|
||||||
|
|
||||||
|
install-npm-modules:
|
||||||
|
description: Install NPM modules
|
||||||
|
steps:
|
||||||
|
- run: yarn
|
||||||
|
|
||||||
|
restore-npm-cache-linux:
|
||||||
|
description: Restore NPM cache
|
||||||
|
steps:
|
||||||
|
- restore_cache:
|
||||||
|
key: node-modules-{{ checksum "yarn.lock" }}
|
||||||
|
|
||||||
|
save-npm-cache-linux:
|
||||||
|
description: Save NPM cache
|
||||||
|
steps:
|
||||||
|
- save_cache:
|
||||||
|
key: node-modules-{{ checksum "yarn.lock" }}
|
||||||
|
paths:
|
||||||
|
- ./node_modules
|
||||||
|
|
||||||
|
restore-npm-cache-mac:
|
||||||
|
description: Restore NPM cache
|
||||||
|
steps:
|
||||||
|
- restore_cache:
|
||||||
|
key: node-v1-mac-{{ checksum "yarn.lock" }}
|
||||||
|
|
||||||
|
save-npm-cache-mac:
|
||||||
|
description: Save NPM cache
|
||||||
|
steps:
|
||||||
|
- save_cache:
|
||||||
|
key: node-v1-mac-{{ checksum "yarn.lock" }}
|
||||||
|
paths:
|
||||||
|
- ./node_modules
|
||||||
|
|
||||||
|
install-node:
|
||||||
|
description: Install Node
|
||||||
|
steps:
|
||||||
|
- run:
|
||||||
|
command: |
|
||||||
|
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
|
||||||
|
source ~/.nvm/nvm.sh
|
||||||
|
INSTALLED_NODE=`nvm which current`
|
||||||
|
echo "export PATH=\"${INSTALLED_NODE%%/node}:\$PATH\"" >> ~/.bash_profile
|
||||||
|
source ~/.bash_profile
|
||||||
|
|
||||||
|
restore-gems-cache:
|
||||||
|
description: Restore gems cache
|
||||||
|
steps:
|
||||||
|
- restore_cache:
|
||||||
|
key: bundle-v1-{{ checksum "ios/Gemfile.lock" }}
|
||||||
|
|
||||||
|
save-gems-cache:
|
||||||
|
description: Save gems cache
|
||||||
|
steps:
|
||||||
|
- save_cache:
|
||||||
|
key: bundle-v1-{{ checksum "ios/Gemfile.lock" }}
|
||||||
|
paths:
|
||||||
|
- vendor/bundle
|
||||||
|
|
||||||
|
update-fastlane-ios:
|
||||||
|
description: Update Fastlane
|
||||||
|
steps:
|
||||||
|
- run:
|
||||||
|
command: |
|
||||||
|
echo "ruby-2.6.4" > ~/.ruby-version
|
||||||
|
bundle install
|
||||||
|
working_directory: ios
|
||||||
|
|
||||||
|
update-fastlane-android:
|
||||||
|
description: Update Fastlane
|
||||||
|
steps:
|
||||||
|
- run:
|
||||||
|
command: |
|
||||||
|
echo "ruby-2.6.4" > ~/.ruby-version
|
||||||
|
bundle install
|
||||||
|
working_directory: android
|
||||||
|
|
||||||
|
restore-gradle-cache:
|
||||||
|
description: Restore gradle cache
|
||||||
|
steps:
|
||||||
|
- restore_cache:
|
||||||
|
key: android-{{ checksum "android/build.gradle" }}-{{ checksum "android/app/build.gradle" }}
|
||||||
|
|
||||||
|
save-gradle-cache:
|
||||||
|
description: Save gradle cache
|
||||||
|
steps:
|
||||||
|
- save_cache:
|
||||||
|
key: android-{{ checksum "android/build.gradle" }}-{{ checksum "android/app/build.gradle" }}
|
||||||
|
paths:
|
||||||
|
- ~/.gradle
|
||||||
|
|
||||||
|
restore-brew-cache:
|
||||||
|
description: Restore Brew cache
|
||||||
|
steps:
|
||||||
|
- restore_cache:
|
||||||
|
key: brew-{{ checksum "yarn.lock" }}-{{ checksum ".circleci/config.yml" }}
|
||||||
|
|
||||||
|
save-brew-cache:
|
||||||
|
description: Save brew cache
|
||||||
|
steps:
|
||||||
|
- save_cache:
|
||||||
|
key: brew-{{ checksum "yarn.lock" }}-{{ checksum ".circleci/config.yml" }}
|
||||||
|
paths:
|
||||||
|
- /usr/local/Homebrew
|
||||||
|
|
||||||
|
install-apple-sim-utils:
|
||||||
|
description: Install appleSimUtils
|
||||||
|
steps:
|
||||||
|
- run:
|
||||||
|
command: |
|
||||||
|
brew update
|
||||||
|
brew tap wix/brew
|
||||||
|
brew install wix/brew/applesimutils
|
||||||
|
|
||||||
|
rebuild-detox:
|
||||||
|
description: Rebuild Detox framework cache
|
||||||
|
steps:
|
||||||
|
- run:
|
||||||
|
command: |
|
||||||
|
npx detox clean-framework-cache
|
||||||
|
npx detox build-framework-cache
|
||||||
|
|
||||||
# JOBS
|
# JOBS
|
||||||
jobs:
|
jobs:
|
||||||
lint-testunit:
|
lint-testunit:
|
||||||
|
@ -149,9 +172,9 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
|
|
||||||
- restore_cache: *restore-npm-cache-linux
|
- restore-npm-cache-linux
|
||||||
|
|
||||||
- run: *install-npm-modules
|
- install-npm-modules
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Lint
|
name: Lint
|
||||||
|
@ -168,7 +191,7 @@ jobs:
|
||||||
command: |
|
command: |
|
||||||
yarn codecov
|
yarn codecov
|
||||||
|
|
||||||
- save_cache: *save-npm-cache-linux
|
- save-npm-cache-linux
|
||||||
|
|
||||||
# E2E
|
# E2E
|
||||||
e2e-build:
|
e2e-build:
|
||||||
|
@ -177,17 +200,17 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
|
|
||||||
- restore_cache: *restore-npm-cache-mac
|
- restore-npm-cache-mac
|
||||||
|
|
||||||
- restore_cache: *restore-brew-cache
|
- restore-brew-cache
|
||||||
|
|
||||||
- run: *install-node
|
- install-node
|
||||||
|
|
||||||
- run: *install-apple-sim-utils
|
- install-apple-sim-utils
|
||||||
|
|
||||||
- run: *install-npm-modules
|
- install-npm-modules
|
||||||
|
|
||||||
- run: *rebuild-detox
|
- rebuild-detox
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Build
|
name: Build
|
||||||
|
@ -199,9 +222,10 @@ jobs:
|
||||||
paths:
|
paths:
|
||||||
- ios/build/Build/Products/Release-iphonesimulator/RocketChatRN.app
|
- ios/build/Build/Products/Release-iphonesimulator/RocketChatRN.app
|
||||||
|
|
||||||
- save_cache: *save-npm-cache-mac
|
- save-npm-cache-mac
|
||||||
|
|
||||||
|
- save-brew-cache
|
||||||
|
|
||||||
- save_cache: *save-brew-cache
|
|
||||||
|
|
||||||
e2e-test-onboarding:
|
e2e-test-onboarding:
|
||||||
executor: mac-env
|
executor: mac-env
|
||||||
|
@ -236,15 +260,15 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
|
|
||||||
- run: *install-node
|
- install-node
|
||||||
|
|
||||||
- restore_cache: *restore-npm-cache-linux
|
- restore-npm-cache-linux
|
||||||
|
|
||||||
- run: *install-npm-modules
|
- install-npm-modules
|
||||||
|
|
||||||
- run: *update-fastlane-android
|
- update-fastlane-android
|
||||||
|
|
||||||
- restore_cache: *restore-gradle-cache
|
- restore-gradle-cache
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Configure Gradle
|
name: Configure Gradle
|
||||||
|
@ -304,9 +328,9 @@ jobs:
|
||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
path: android/app/build/outputs
|
path: android/app/build/outputs
|
||||||
|
|
||||||
- save_cache: *save-npm-cache-linux
|
- save-npm-cache-linux
|
||||||
|
|
||||||
- save_cache: *save-gradle-cache
|
- save-gradle-cache
|
||||||
|
|
||||||
- persist_to_workspace:
|
- persist_to_workspace:
|
||||||
root: .
|
root: .
|
||||||
|
@ -330,7 +354,7 @@ jobs:
|
||||||
command: echo "$FASTLANE_GOOGLE_SERVICE_ACCOUNT" | base64 --decode > service_account.json
|
command: echo "$FASTLANE_GOOGLE_SERVICE_ACCOUNT" | base64 --decode > service_account.json
|
||||||
working_directory: android
|
working_directory: android
|
||||||
|
|
||||||
- run: *update-fastlane-android
|
- update-fastlane-android
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Fastlane Play Store Upload
|
name: Fastlane Play Store Upload
|
||||||
|
@ -344,15 +368,15 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
|
|
||||||
- restore_cache: *restore-gems-cache
|
- restore-gems-cache
|
||||||
|
|
||||||
- restore_cache: *restore-npm-cache-mac
|
- restore-npm-cache-mac
|
||||||
|
|
||||||
- run: *install-node
|
- install-node
|
||||||
|
|
||||||
- run: *install-npm-modules
|
- install-npm-modules
|
||||||
|
|
||||||
- run: *update-fastlane-ios
|
- update-fastlane-ios
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Set Google Services
|
name: Set Google Services
|
||||||
|
@ -390,9 +414,9 @@ jobs:
|
||||||
fi
|
fi
|
||||||
working_directory: ios
|
working_directory: ios
|
||||||
|
|
||||||
- save_cache: *save-npm-cache-mac
|
- save-npm-cache-mac
|
||||||
|
|
||||||
- save_cache: *save-gems-cache
|
- save-gems-cache
|
||||||
|
|
||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
path: ios/RocketChatRN.ipa
|
path: ios/RocketChatRN.ipa
|
||||||
|
@ -412,9 +436,9 @@ jobs:
|
||||||
- attach_workspace:
|
- attach_workspace:
|
||||||
at: ios
|
at: ios
|
||||||
|
|
||||||
- restore_cache: *restore-gems-cache
|
- restore-gems-cache
|
||||||
|
|
||||||
- run: *update-fastlane-ios
|
- update-fastlane-ios
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Fastlane Tesflight Upload
|
name: Fastlane Tesflight Upload
|
||||||
|
@ -422,7 +446,7 @@ jobs:
|
||||||
bundle exec fastlane ios beta
|
bundle exec fastlane ios beta
|
||||||
working_directory: ios
|
working_directory: ios
|
||||||
|
|
||||||
- save_cache: *save-gems-cache
|
- save-gems-cache
|
||||||
|
|
||||||
workflows:
|
workflows:
|
||||||
build-and-test:
|
build-and-test:
|
||||||
|
|
Loading…
Reference in New Issue