CI refactor
This commit is contained in:
parent
100824ebd0
commit
7721bc3489
|
@ -1,6 +1,13 @@
|
||||||
defaults: &defaults
|
defaults: &defaults
|
||||||
working_directory: ~/repo
|
working_directory: ~/repo
|
||||||
|
|
||||||
|
macos: &macos
|
||||||
|
macos:
|
||||||
|
xcode: "11.2.1"
|
||||||
|
|
||||||
|
bash-env: &bash-env
|
||||||
|
BASH_ENV: "~/.nvm/nvm.sh"
|
||||||
|
|
||||||
install-npm-modules: &install-npm-modules
|
install-npm-modules: &install-npm-modules
|
||||||
name: Install NPM modules
|
name: Install NPM modules
|
||||||
command: yarn
|
command: yarn
|
||||||
|
@ -25,6 +32,47 @@ save-npm-cache-mac: &save-npm-cache-mac
|
||||||
paths:
|
paths:
|
||||||
- ./node_modules
|
- ./node_modules
|
||||||
|
|
||||||
|
install-node: &install-node
|
||||||
|
name: Install Node 10
|
||||||
|
command: |
|
||||||
|
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh | bash
|
||||||
|
source ~/.nvm/nvm.sh
|
||||||
|
# https://github.com/creationix/nvm/issues/1394
|
||||||
|
set +e
|
||||||
|
nvm install 10
|
||||||
|
echo 'export PATH="/home/circleci/.nvm/versions/node/v10.20.1/bin:$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: &update-fastlane
|
||||||
|
name: Update Fastlane
|
||||||
|
command: |
|
||||||
|
echo "ruby-2.6.4" > ~/.ruby-version
|
||||||
|
bundle install
|
||||||
|
working_directory: ios
|
||||||
|
|
||||||
|
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: |
|
||||||
|
detox clean-framework-cache
|
||||||
|
detox build-framework-cache
|
||||||
|
|
||||||
version: 2
|
version: 2
|
||||||
jobs:
|
jobs:
|
||||||
lint-testunit:
|
lint-testunit:
|
||||||
|
@ -59,41 +107,25 @@ jobs:
|
||||||
|
|
||||||
- save_cache: *save-npm-cache-linux
|
- save_cache: *save-npm-cache-linux
|
||||||
|
|
||||||
|
# E2E
|
||||||
e2e-build:
|
e2e-build:
|
||||||
macos:
|
<<: *macos
|
||||||
xcode: "11.2.1"
|
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
BASH_ENV: "~/.nvm/nvm.sh"
|
<<: *bash-env
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
|
|
||||||
- restore_cache: *restore-npm-cache-mac
|
- restore_cache: *restore-npm-cache-mac
|
||||||
|
|
||||||
- run:
|
- run: *install-node
|
||||||
name: Install Node 10
|
|
||||||
command: |
|
|
||||||
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh | bash
|
|
||||||
source ~/.nvm/nvm.sh
|
|
||||||
# https://github.com/creationix/nvm/issues/1394
|
|
||||||
set +e
|
|
||||||
nvm install 10
|
|
||||||
|
|
||||||
- run:
|
- run: *install-apple-sim-utils
|
||||||
name: Install appleSimUtils
|
|
||||||
command: |
|
|
||||||
brew update
|
|
||||||
brew tap wix/brew
|
|
||||||
brew install wix/brew/applesimutils
|
|
||||||
|
|
||||||
- run: *install-npm-modules
|
- run: *install-npm-modules
|
||||||
|
|
||||||
- run:
|
- run: *rebuild-detox
|
||||||
name: Rebuild Detox framework cache
|
|
||||||
command: |
|
|
||||||
detox clean-framework-cache
|
|
||||||
detox build-framework-cache
|
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Build
|
name: Build
|
||||||
|
@ -108,11 +140,10 @@ jobs:
|
||||||
- save_cache: *save-npm-cache-mac
|
- save_cache: *save-npm-cache-mac
|
||||||
|
|
||||||
e2e-test:
|
e2e-test:
|
||||||
macos:
|
<<: *macos
|
||||||
xcode: "11.2.1"
|
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
BASH_ENV: "~/.nvm/nvm.sh"
|
<<: *bash-env
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
|
@ -122,29 +153,13 @@ jobs:
|
||||||
|
|
||||||
- restore_cache: *restore-npm-cache-mac
|
- restore_cache: *restore-npm-cache-mac
|
||||||
|
|
||||||
- run:
|
- run: *install-node
|
||||||
name: Install Node 10
|
|
||||||
command: |
|
|
||||||
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh | bash
|
|
||||||
source ~/.nvm/nvm.sh
|
|
||||||
# https://github.com/creationix/nvm/issues/1394
|
|
||||||
set +e
|
|
||||||
nvm install 10
|
|
||||||
|
|
||||||
- run:
|
- run: *install-apple-sim-utils
|
||||||
name: Install appleSimUtils
|
|
||||||
command: |
|
|
||||||
brew update
|
|
||||||
brew tap wix/brew
|
|
||||||
brew install wix/brew/applesimutils
|
|
||||||
|
|
||||||
- run: *install-npm-modules
|
- run: *install-npm-modules
|
||||||
|
|
||||||
- run:
|
- run: *rebuild-detox
|
||||||
name: Rebuild Detox framework cache
|
|
||||||
command: |
|
|
||||||
detox clean-framework-cache
|
|
||||||
detox build-framework-cache
|
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Test
|
name: Test
|
||||||
|
@ -153,33 +168,22 @@ jobs:
|
||||||
|
|
||||||
- save_cache: *save-npm-cache-mac
|
- save_cache: *save-npm-cache-mac
|
||||||
|
|
||||||
|
# Android builds
|
||||||
android-build:
|
android-build:
|
||||||
<<: *defaults
|
<<: *defaults
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/android:api-28-node
|
- image: circleci/android:api-28-node
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
# GRADLE_OPTS: -Dorg.gradle.jvmargs="-Xmx4096m -XX:+HeapDumpOnOutOfMemoryError"
|
|
||||||
# GRADLE_OPTS: -Xmx2048m -Dorg.gradle.daemon=false
|
|
||||||
# JVM_OPTS: -Xmx4096m
|
|
||||||
JAVA_OPTS: '-Xms512m -Xmx2g'
|
JAVA_OPTS: '-Xms512m -Xmx2g'
|
||||||
GRADLE_OPTS: '-Xmx3g -Dorg.gradle.daemon=false -Dorg.gradle.jvmargs="-Xmx2g -XX:+HeapDumpOnOutOfMemoryError"'
|
GRADLE_OPTS: '-Xmx3g -Dorg.gradle.daemon=false -Dorg.gradle.jvmargs="-Xmx2g -XX:+HeapDumpOnOutOfMemoryError"'
|
||||||
TERM: dumb
|
TERM: dumb
|
||||||
BASH_ENV: "~/.nvm/nvm.sh"
|
<<: *bash-env
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
|
|
||||||
- run:
|
- run: *install-node
|
||||||
name: Install Node 10
|
|
||||||
command: |
|
|
||||||
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh | bash
|
|
||||||
source ~/.nvm/nvm.sh
|
|
||||||
# https://github.com/creationix/nvm/issues/1394
|
|
||||||
set +e
|
|
||||||
nvm install 10
|
|
||||||
echo 'export PATH="/home/circleci/.nvm/versions/node/v10.20.1/bin:$PATH"' >> ~/.bash_profile
|
|
||||||
source ~/.bash_profile
|
|
||||||
|
|
||||||
- restore_cache: *restore-npm-cache-linux
|
- restore_cache: *restore-npm-cache-linux
|
||||||
|
|
||||||
|
@ -259,39 +263,25 @@ jobs:
|
||||||
paths:
|
paths:
|
||||||
- ~/.gradle
|
- ~/.gradle
|
||||||
|
|
||||||
|
# iOS builds
|
||||||
ios-build:
|
ios-build:
|
||||||
macos:
|
<<: *macos
|
||||||
xcode: "11.2.1"
|
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
BASH_ENV: "~/.nvm/nvm.sh"
|
<<: *bash-env
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
|
|
||||||
- restore_cache:
|
- restore_cache: *restore-gems-cache
|
||||||
name: Restore gems cache
|
|
||||||
key: bundle-v1-{{ checksum "ios/Gemfile.lock" }}
|
|
||||||
|
|
||||||
- restore_cache: *restore-npm-cache-linux
|
- restore_cache: *restore-npm-cache-mac
|
||||||
|
|
||||||
- run:
|
- run: *install-node
|
||||||
name: Install Node 10
|
|
||||||
command: |
|
|
||||||
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh | bash
|
|
||||||
source ~/.nvm/nvm.sh
|
|
||||||
# https://github.com/creationix/nvm/issues/1394
|
|
||||||
set +e
|
|
||||||
nvm install 10
|
|
||||||
|
|
||||||
- run: *install-npm-modules
|
- run: *install-npm-modules
|
||||||
|
|
||||||
- run:
|
- run: *update-fastlane
|
||||||
name: Update Fastlane
|
|
||||||
command: |
|
|
||||||
echo "ruby-2.6.4" > ~/.ruby-version
|
|
||||||
bundle install
|
|
||||||
working_directory: ios
|
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Set Google Services
|
name: Set Google Services
|
||||||
|
@ -329,13 +319,9 @@ jobs:
|
||||||
fi
|
fi
|
||||||
working_directory: ios
|
working_directory: ios
|
||||||
|
|
||||||
- save_cache: *save-npm-cache-linux
|
- save_cache: *save-npm-cache-mac
|
||||||
|
|
||||||
- save_cache:
|
- save_cache: *save-gems-cache
|
||||||
name: Save gems cache
|
|
||||||
key: bundle-v1-{{ checksum "ios/Gemfile.lock" }}
|
|
||||||
paths:
|
|
||||||
- vendor/bundle
|
|
||||||
|
|
||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
path: ios/RocketChatRN.ipa
|
path: ios/RocketChatRN.ipa
|
||||||
|
@ -347,8 +333,7 @@ jobs:
|
||||||
- ios/fastlane/report.xml
|
- ios/fastlane/report.xml
|
||||||
|
|
||||||
ios-testflight:
|
ios-testflight:
|
||||||
macos:
|
<<: *macos
|
||||||
xcode: "11.2.1"
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
|
@ -356,16 +341,9 @@ jobs:
|
||||||
- attach_workspace:
|
- attach_workspace:
|
||||||
at: ios
|
at: ios
|
||||||
|
|
||||||
- restore_cache:
|
- restore_cache: *restore-gems-cache
|
||||||
name: Restore gems cache
|
|
||||||
key: bundle-v1-{{ checksum "ios/Gemfile.lock" }}
|
|
||||||
|
|
||||||
- run:
|
- run: *update-fastlane
|
||||||
name: Update Fastlane
|
|
||||||
command: |
|
|
||||||
echo "ruby-2.4" > ~/.ruby-version
|
|
||||||
bundle install
|
|
||||||
working_directory: ios
|
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Fastlane Tesflight Upload
|
name: Fastlane Tesflight Upload
|
||||||
|
@ -373,11 +351,7 @@ jobs:
|
||||||
bundle exec fastlane ios beta
|
bundle exec fastlane ios beta
|
||||||
working_directory: ios
|
working_directory: ios
|
||||||
|
|
||||||
- save_cache:
|
- save_cache: *save-gems-cache
|
||||||
name: Save gems cache
|
|
||||||
key: bundle-v1-{{ checksum "ios/Gemfile.lock" }}
|
|
||||||
paths:
|
|
||||||
- vendor/bundle
|
|
||||||
|
|
||||||
workflows:
|
workflows:
|
||||||
version: 2
|
version: 2
|
||||||
|
|
Loading…
Reference in New Issue