-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
117da31
commit aa2d48c
Showing
2 changed files
with
154 additions
and
231 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,27 @@ | ||
version: 2.1 | ||
|
||
orbs: | ||
gh: circleci/[email protected] | ||
gh: circleci/github-cli@2.3.0 | ||
node: circleci/[email protected] | ||
android: circleci/[email protected] | ||
rn: react-native-community/[email protected] | ||
|
||
commands: | ||
e2e_build_android_cmd: | ||
steps: | ||
- android/restore-gradle-cache | ||
- run: | | ||
yarn e2e:build android.emu.debug | ||
- android/save-gradle-cache | ||
install_java: | ||
steps: | ||
- run: | ||
name: Install OpenJDK 11 | ||
command: | | ||
sudo apt-get update && sudo apt-get install -y openjdk-11-jdk | ||
sudo update-alternatives --set java /usr/lib/jvm/java-11-openjdk-amd64/bin/java | ||
sudo update-alternatives --set javac /usr/lib/jvm/java-11-openjdk-amd64/bin/javac | ||
java -version | ||
parameters: | ||
version: | ||
|
@@ -28,141 +47,43 @@ parameters: | |
default: "" | ||
|
||
jobs: | ||
test_android_in_pr: | ||
docker: | ||
- image: cimg/android:2022.12 | ||
resource_class: xlarge | ||
environment: | ||
TERM: dumb | ||
JAVA_OPTS: -Xms512m -Xmx2g | ||
GRADLE_OPTS: -Xmx3g -Dorg.gradle.daemon=false -Dorg.gradle.jvmargs="-Xmx2g -XX:+HeapDumpOnOutOfMemoryError" | ||
working_directory: ~/galoy-mobile | ||
shell: /bin/bash --login -o pipefail | ||
e2e_build_android: | ||
executor: | ||
name: rn/linux_android | ||
resource_class: xlarge | ||
steps: | ||
# if workflow was triggered by API then don't run the test jobs | ||
- run: | | ||
if [ << pipeline.trigger_source >> = "api" ]; then | ||
circleci-agent step halt | ||
fi | ||
- checkout: | ||
path: ~/galoy-mobile | ||
|
||
- checkout | ||
- node/install: | ||
install-yarn: true | ||
node-version: '18.18.2' | ||
|
||
- run: sudo apt-get install gcc g++ make | ||
- run: gpg --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB | ||
|
||
- restore_cache: | ||
key: 1-gem-{{ checksum "android/Gemfile.lock" }} | ||
- run: cd android && bundle config set deployment 'true' | ||
- run: cd android && bundle check || bundle install | ||
- save_cache: | ||
key: 1-gem-{{ checksum "android/Gemfile.lock" }} | ||
- install_java | ||
- rn/yarn_install | ||
- e2e_build_android_cmd | ||
- persist_to_workspace: | ||
root: ~/galoy-mobile | ||
paths: | ||
- android/vendor | ||
|
||
- restore_cache: | ||
key: yarn-{{ checksum "yarn.lock" }} | ||
- run: yarn install | ||
- save_cache: | ||
key: yarn-{{ checksum "yarn.lock" }} | ||
paths: | ||
- node_modules | ||
- run: echo $RELEASE_KEYSTORE | base64 -d > android/app/release.keystore | ||
- run: yarn android:prepareAssets | ||
- run: | ||
name: Test Browserstack | ||
command: | | ||
set -o pipefail | ||
cd android && bundle exec fastlane browserstack | tee browserstack_output.log | ||
error_code=$? | ||
SESSION_ID=$(cat browserstack_output.log | grep sessionId | head -n1 | sed -n "s/^.*'\(.*\)'.*$/\1/ p") | ||
echo "Session ID" | ||
echo $SESSION_ID | ||
echo "Browserstack URL" | ||
echo "https://app-automate.browserstack.com/dashboard/v2/builds/$BROWSERSTACK_ANDROID_BUILD/sessions/$SESSION_ID" | ||
VIDEO_URL=$(curl -s -u "$BROWSERSTACK_USER:$BROWSERSTACK_ACCESS_KEY" -X GET "https://api-cloud.browserstack.com/app-automate/sessions/$SESSION_ID.json" | jq -r '.automation_session.video_url') | ||
echo "Video URL" | ||
echo $VIDEO_URL | ||
exit $error_code | ||
test_ios_in_pr: | ||
macos: | ||
xcode: 14.2.0 | ||
resource_class: macos.x86.medium.gen2 | ||
working_directory: ~/galoy-mobile | ||
environment: | ||
FL_OUTPUT_DIR: output | ||
shell: /bin/bash --login -o pipefail | ||
- android/app/build | ||
e2e_run_android: | ||
executor: | ||
name: android/android-machine | ||
resource-class: xlarge | ||
tag: 2023.12.1 | ||
steps: | ||
# if workflow was triggered by API then don't run the test jobs | ||
- run: | | ||
if [ << pipeline.trigger_source >> = "api" ]; then | ||
circleci-agent step halt | ||
fi | ||
- checkout: | ||
path: ~/galoy-mobile | ||
|
||
- run: | ||
name: Check Ruby version | ||
command: | | ||
rbenv versions | ||
echo "Ruby version in .ruby-version:" | ||
cat .ruby-version | ||
echo "Ruby version in Gemfile:" | ||
grep -E "^ruby" Gemfile | ||
- run: | ||
name: Install Bundler 2.2.30 | ||
command: | | ||
gem install bundler:2.2.30 | ||
echo "export BUNDLE_PATH=$(bundle show --path)" >> $BASH_ENV | ||
source $BASH_ENV | ||
- add_ssh_keys: | ||
fingerprints: | ||
- "19:7e:f3:6c:be:a7:17:01:7d:09:ca:39:c3:98:86:90" | ||
- restore_cache: | ||
key: 1-gem-{{ checksum "ios/Gemfile.lock" }} | ||
- run: cd ios && bundle config set deployment 'true' | ||
- run: cd ios && bundle config set --local path 'vendor/bundle' | ||
- run: cd ios && bundle check || bundle install | ||
- run: gem install cocoapods | ||
- save_cache: | ||
key: 1-gem-{{ checksum "ios/Gemfile.lock" }} | ||
paths: | ||
- ios/vendor | ||
- restore_cache: | ||
key: 1-yarn-{{ checksum "yarn.lock" }}-pod1-{{ checksum "ios/Podfile.lock" }} | ||
- run: yarn install | ||
- save_cache: | ||
key: 1-yarn-{{ checksum "yarn.lock" }}-pod1-{{ checksum "ios/Podfile.lock" }} | ||
paths: | ||
- node_modules | ||
- ios/Pods | ||
- run: | ||
name: Import Apple Certificates | ||
command: | | ||
tmpfile=$(mktemp /tmp/wwdr-cert.cer) | ||
curl -f -o $tmpfile https://www.apple.com/certificateauthority/AppleWWDRCAG3.cer && security import $tmpfile ~/Library/Keychains/login.keychain-db | ||
- run: | ||
name: Browserstack Testing | ||
command: | | ||
set -o pipefail | ||
cd ios && bundle exec fastlane browserstack | tee browserstack_output.log | ||
error_code=$? | ||
SESSION_ID=$(cat browserstack_output.log | grep sessionId | head -n1 | sed -n "s/^.*'\(.*\)'.*$/\1/ p") | ||
echo "Session ID" | ||
echo $SESSION_ID | ||
echo "Browserstack URL" | ||
echo "https://app-automate.browserstack.com/dashboard/v2/builds/$BROWSERSTACK_IOS_BUILD/sessions/$SESSION_ID" | ||
VIDEO_URL=$(curl -s -u "$BROWSERSTACK_USER:$BROWSERSTACK_ACCESS_KEY" -X GET "https://api-cloud.browserstack.com/app-automate/sessions/$SESSION_ID.json" | jq -r '.automation_session.video_url') | ||
echo "Video URL" | ||
echo $VIDEO_URL | ||
exit $error_code | ||
no_output_timeout: 15m | ||
- attach_workspace: | ||
at: . | ||
- node/install: | ||
install-yarn: true | ||
node-version: '18.18.2' | ||
- rn/yarn_install | ||
- android/create-avd: | ||
avd-name: Pixel_API_29_AOSP | ||
install: true | ||
system-image: system-images;android-29;default;x86 | ||
- android/start-emulator: | ||
avd-name: Pixel_API_29_AOSP | ||
no-window: true | ||
post-emulator-launch-assemble-command: "" | ||
- run: yarn e2e:test android.emu.debug --headless -d -R 3 --record-videos | ||
|
||
build_android: | ||
docker: | ||
|
@@ -354,5 +275,7 @@ workflows: | |
not: | ||
equal: [main, << pipeline.git.branch >>] | ||
jobs: | ||
- test_android_in_pr | ||
- test_ios_in_pr | ||
- e2e_build_android | ||
- e2e_run_android: | ||
requires: | ||
- e2e_build_android |
Oops, something went wrong.