-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Showing
199 changed files
with
4,380 additions
and
5,796 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,6 +1,9 @@ | ||
defaults: &defaults | ||
working_directory: ~/repo | ||
|
||
orbs: | ||
android: circleci/[email protected] | ||
|
||
macos: &macos | ||
macos: | ||
xcode: "14.2.0" | ||
|
@@ -327,6 +330,14 @@ commands: | |
working_directory: ios | ||
- save_cache: *save-gems-cache | ||
|
||
create-e2e-account-file: | ||
description: "Create e2e account file" | ||
steps: | ||
- run: | ||
command: | | ||
echo $E2E_ACCOUNT | base64 --decode > ./e2e_account.ts | ||
working_directory: e2e | ||
|
||
version: 2.1 | ||
|
||
# EXECUTORS | ||
|
@@ -438,6 +449,94 @@ jobs: | |
- upload-to-google-play-beta: | ||
official: true | ||
|
||
e2e-build-android: | ||
<<: *defaults | ||
executor: | ||
name: android/android-machine | ||
resource-class: xlarge | ||
tag: 2022.12.1 | ||
environment: | ||
<<: *android-env | ||
steps: | ||
- checkout | ||
- restore_cache: *restore-npm-cache-linux | ||
- run: *install-npm-modules | ||
- save_cache: *save-npm-cache-linux | ||
- restore_cache: *restore-gradle-cache | ||
- run: | ||
name: Configure Gradle | ||
command: | | ||
echo -e "" > ./gradle.properties | ||
# echo -e "android.enableAapt2=false" >> ./gradle.properties | ||
echo -e "android.useAndroidX=true" >> ./gradle.properties | ||
echo -e "android.enableJetifier=true" >> ./gradle.properties | ||
echo -e "newArchEnabled=false" >> ./gradle.properties | ||
echo -e "FLIPPER_VERSION=0.125.0" >> ./gradle.properties | ||
echo -e "VERSIONCODE=$CIRCLE_BUILD_NUM" >> ./gradle.properties | ||
echo -e "APPLICATION_ID=chat.rocket.reactnative" >> ./gradle.properties | ||
echo -e "BugsnagAPIKey=$BUGSNAG_KEY" >> ./gradle.properties | ||
echo $KEYSTORE_EXPERIMENTAL_BASE64 | base64 --decode > ./app/$KEYSTORE_EXPERIMENTAL | ||
echo -e "KEYSTORE=$KEYSTORE_EXPERIMENTAL" >> ./gradle.properties | ||
echo -e "KEYSTORE_PASSWORD=$KEYSTORE_EXPERIMENTAL_PASSWORD" >> ./gradle.properties | ||
echo -e "KEY_ALIAS=$KEYSTORE_EXPERIMENTAL_ALIAS" >> ./gradle.properties | ||
echo -e "KEY_PASSWORD=$KEYSTORE_EXPERIMENTAL_PASSWORD" >> ./gradle.properties | ||
working_directory: android | ||
- run: | ||
name: Build Android | ||
command: | | ||
export RUNNING_E2E_TESTS=true | ||
yarn e2e:android-build | ||
- save_cache: *save-gradle-cache | ||
- store_artifacts: | ||
path: android/app/build/outputs/apk/experimentalPlay/release/app-experimental-play-release.apk | ||
- store_artifacts: | ||
path: android/app/build/outputs/apk/androidTest/experimentalPlay/release/app-experimental-play-release-androidTest.apk | ||
- persist_to_workspace: | ||
root: /home/circleci/repo | ||
paths: | ||
- android/app/build/outputs/apk/ | ||
|
||
e2e-test-android: | ||
<<: *defaults | ||
executor: | ||
name: android/android-machine | ||
resource-class: xlarge | ||
tag: 2022.12.1 | ||
parallelism: 4 | ||
steps: | ||
- checkout | ||
- attach_workspace: | ||
at: /home/circleci/repo | ||
- restore_cache: *restore-npm-cache-linux | ||
- run: *install-npm-modules | ||
- save_cache: *save-npm-cache-linux | ||
- run: mkdir ~/junit | ||
- create-e2e-account-file | ||
- android/create-avd: | ||
avd-name: Pixel_API_31_AOSP | ||
install: true | ||
system-image: system-images;android-31;default;x86_64 | ||
- run: | ||
name: Setup emulator | ||
command: | | ||
echo "hw.lcd.density = 440" >> ~/.android/avd/Pixel_API_31_AOSP.avd/config.ini | ||
echo "hw.lcd.height = 2280" >> ~/.android/avd/Pixel_API_31_AOSP.avd/config.ini | ||
echo "hw.lcd.width = 1080" >> ~/.android/avd/Pixel_API_31_AOSP.avd/config.ini | ||
- run: | ||
name: Run Detox Tests | ||
command: | | ||
TEST=$(circleci tests glob "e2e/tests/**/*.ts" | circleci tests split --split-by=timings) | ||
yarn e2e:android-test $TEST | ||
- store_artifacts: | ||
path: artifacts | ||
- run: | ||
command: cp junit.xml ~/junit/ | ||
when: always | ||
- store_test_results: | ||
path: ~/junit | ||
- store_artifacts: | ||
path: ~/junit | ||
|
||
# iOS builds | ||
ios-build-experimental: | ||
executor: mac-env | ||
|
@@ -461,11 +560,89 @@ jobs: | |
- upload-to-testflight: | ||
official: true | ||
|
||
e2e-build-ios: | ||
executor: mac-env | ||
steps: | ||
- checkout | ||
- restore_cache: *restore-gems-cache | ||
- restore_cache: *restore-npm-cache-mac | ||
- run: *install-npm-modules | ||
- run: *update-fastlane-ios | ||
- save_cache: *save-npm-cache-mac | ||
- save_cache: *save-gems-cache | ||
- manage-pods | ||
- run: | ||
name: Configure Detox | ||
command: | | ||
brew tap wix/brew | ||
brew install applesimutils | ||
- run: | ||
name: Build | ||
command: | | ||
/usr/libexec/PlistBuddy -c "Set :bugsnag:apiKey $BUGSNAG_KEY" ./ios/RocketChatRN/Info.plist | ||
/usr/libexec/PlistBuddy -c "Set :bugsnag:apiKey $BUGSNAG_KEY" ./ios/ShareRocketChatRN/Info.plist | ||
yarn detox clean-framework-cache && yarn detox build-framework-cache | ||
export RUNNING_E2E_TESTS=true | ||
yarn e2e:ios-build | ||
- persist_to_workspace: | ||
root: /Users/distiller/project | ||
paths: | ||
- ios/build/Build/Products/Release-iphonesimulator/Rocket.Chat Experimental.app | ||
|
||
e2e-test-ios: | ||
executor: mac-env | ||
parallelism: 5 | ||
steps: | ||
- checkout | ||
- attach_workspace: | ||
at: /Users/distiller/project | ||
- restore_cache: *restore-npm-cache-mac | ||
- run: *install-npm-modules | ||
- save_cache: *save-npm-cache-mac | ||
- run: mkdir ~/junit | ||
- run: | ||
name: Configure Detox | ||
command: | | ||
brew tap wix/brew | ||
brew install applesimutils | ||
yarn detox clean-framework-cache && yarn detox build-framework-cache | ||
- create-e2e-account-file | ||
- run: | ||
name: Run tests | ||
command: | | ||
TEST=$(circleci tests glob "e2e/tests/**/*.ts" | circleci tests split --split-by=timings) | ||
yarn e2e:ios-test $TEST | ||
- store_artifacts: | ||
path: artifacts | ||
- run: | ||
command: cp junit.xml ~/junit/ | ||
when: always | ||
- store_test_results: | ||
path: ~/junit | ||
- store_artifacts: | ||
path: ~/junit | ||
|
||
workflows: | ||
build-and-test: | ||
jobs: | ||
- lint-testunit | ||
|
||
# E2E tests | ||
- e2e-hold: | ||
type: approval | ||
- e2e-build-ios: | ||
requires: | ||
- e2e-hold | ||
- e2e-test-ios: | ||
requires: | ||
- e2e-build-ios | ||
- e2e-build-android: | ||
requires: | ||
- e2e-hold | ||
- e2e-test-android: | ||
requires: | ||
- e2e-build-android | ||
|
||
# iOS Experimental | ||
- ios-hold-build-experimental: | ||
type: approval | ||
|
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 |
---|---|---|
@@ -0,0 +1,91 @@ | ||
/** @type {Detox.DetoxConfig} */ | ||
module.exports = { | ||
testRunner: { | ||
args: { | ||
$0: 'jest', | ||
config: 'e2e/jest.config.js' | ||
}, | ||
retries: process.env.CI ? 3 : 0 | ||
}, | ||
artifacts: { | ||
plugins: { | ||
screenshot: 'failing', | ||
video: 'failing', | ||
uiHierarchy: 'enabled' | ||
} | ||
}, | ||
apps: { | ||
'ios.debug': { | ||
type: 'ios.app', | ||
binaryPath: 'ios/build/Build/Products/Debug-iphonesimulator/Rocket.Chat Experimental.app', | ||
build: | ||
'xcodebuild -workspace ios/RocketChatRN.xcworkspace -scheme RocketChatRN -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build' | ||
}, | ||
'ios.release': { | ||
type: 'ios.app', | ||
binaryPath: 'ios/build/Build/Products/Release-iphonesimulator/Rocket.Chat Experimental.app', | ||
build: | ||
'xcodebuild -workspace ios/RocketChatRN.xcworkspace -scheme RocketChatRN -configuration Release -sdk iphonesimulator -derivedDataPath ios/build' | ||
}, | ||
'android.debug': { | ||
type: 'android.apk', | ||
binaryPath: 'android/app/build/outputs/apk/experimentalPlay/debug/app-experimental-play-debug.apk', | ||
build: | ||
'cd android ; ./gradlew assembleExperimentalPlayDebug assembleExperimentalPlayDebugAndroidTest -DtestBuildType=debug ; cd -', | ||
reversePorts: [8081] | ||
}, | ||
'android.release': { | ||
type: 'android.apk', | ||
binaryPath: 'android/app/build/outputs/apk/experimentalPlay/release/app-experimental-play-release.apk', | ||
build: | ||
'cd android ; ./gradlew assembleExperimentalPlayRelease assembleExperimentalPlayReleaseAndroidTest -DtestBuildType=release ; cd -' | ||
} | ||
}, | ||
devices: { | ||
simulator: { | ||
type: 'ios.simulator', | ||
device: { | ||
type: 'iPhone 14' | ||
} | ||
}, | ||
attached: { | ||
type: 'android.attached', | ||
device: { | ||
adbName: '.*' | ||
} | ||
}, | ||
emulator: { | ||
type: 'android.emulator', | ||
device: { | ||
avdName: 'Pixel_API_31_AOSP' | ||
}, | ||
headless: process.env.CI ? true : false | ||
} | ||
}, | ||
configurations: { | ||
'ios.sim.debug': { | ||
device: 'simulator', | ||
app: 'ios.debug' | ||
}, | ||
'ios.sim.release': { | ||
device: 'simulator', | ||
app: 'ios.release' | ||
}, | ||
'android.att.debug': { | ||
device: 'attached', | ||
app: 'android.debug' | ||
}, | ||
'android.att.release': { | ||
device: 'attached', | ||
app: 'android.release' | ||
}, | ||
'android.emu.debug': { | ||
device: 'emulator', | ||
app: 'android.debug' | ||
}, | ||
'android.emu.release': { | ||
device: 'emulator', | ||
app: 'android.release' | ||
} | ||
} | ||
}; |
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
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
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
Oops, something went wrong.