-
Notifications
You must be signed in to change notification settings - Fork 35
[MOB-9674] fix-integration-tests #586
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 2.0.0-alpha/MOB-9673-fix-unit-tests
Are you sure you want to change the base?
Changes from all commits
61662a8
9747ed5
c9421f7
5e8d16d
f7670a1
3a8cde0
a4bd21d
cb86083
deb4a70
46993b3
1e03b87
0b60067
57e4b60
d945808
5e722bd
98c75d4
5678009
562863d
110d5bc
c36d101
faba310
ceebc47
c5d08b6
0042b1c
9c7385e
6acba1e
87bfa0d
4a68d90
ca39dbe
4bd77e1
a92375b
d5acb3b
2fd5ac3
66ae58a
bad25ca
479f548
93ae7c8
2365352
29f2a5e
dfbb361
61247f6
0b8b035
73888b6
a364685
9baee4c
a3e9afd
48db651
4b554a6
4489eb1
a8d58d3
531763f
5ef7f22
6e00bc5
91b3ed0
9b32b26
838ae6b
fd5139f
4aacc86
5b06aed
9b2f0ba
d95a9c7
e1d223f
6d4ce1e
a5d1670
d5f69ed
061aa28
08a897b
9887a1a
f596d5f
96a05d2
9475bbc
ad3701f
966344c
c9ad35b
6815c79
0d62930
d211cb3
f1cbb3f
511060f
3e8c311
3b544f9
e5562e9
7164c6f
8dcc21a
43a1ee2
1521875
34cc21d
9128cfb
d2e0ddd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,83 @@ | ||||||
version: 2.1 | ||||||
|
||||||
orbs: | ||||||
node: circleci/[email protected] | ||||||
|
||||||
references: | ||||||
machine_config: &machine_config | ||||||
machine: | ||||||
image: default | ||||||
|
||||||
defaults: &defaults | ||||||
resource_class: large | ||||||
working_directory: ~/react-native-sdk | ||||||
docker: | ||||||
- image: cimg/node:20.10 | ||||||
|
||||||
executors: | ||||||
detox-executor: | ||||||
macos: | ||||||
xcode: "14.3.1" # Use the appropriate Xcode version for your project | ||||||
working_directory: ~/react-native-sdk | ||||||
|
||||||
jobs: | ||||||
detox: | ||||||
<<: *defaults | ||||||
executor: detox-executor | ||||||
steps: | ||||||
- checkout | ||||||
|
||||||
- run: | ||||||
name: Install Node.js | ||||||
command: | | ||||||
node -v | ||||||
npm -v | ||||||
|
||||||
- run: | ||||||
name: Install Yarn | ||||||
command: | | ||||||
npm install -g yarn | ||||||
yarn -v | ||||||
|
||||||
- run: | ||||||
name: Install Detox CLI | ||||||
command: | | ||||||
npm install -g detox-cli | ||||||
|
||||||
- run: | ||||||
name: Install Project Dependencies | ||||||
command: | | ||||||
yarn install | ||||||
|
||||||
- run: | ||||||
name: Install Example Dependencies | ||||||
command: | | ||||||
cd example | ||||||
yarn install | ||||||
cd .. | ||||||
|
||||||
- run: | ||||||
name: Install iOS Dependencies | ||||||
command: | | ||||||
cd example/ios | ||||||
pod install | ||||||
cd ../.. | ||||||
|
||||||
- run: | ||||||
name: Build the App for Detox | ||||||
command: | | ||||||
cd example | ||||||
detox build --configuration ios.sim.release | ||||||
cd .. | ||||||
|
||||||
- run: | ||||||
name: Run Detox Tests | ||||||
command: | | ||||||
cd example | ||||||
detox test --configuration ios.sim.release | ||||||
cd .. | ||||||
|
||||||
workflows: | ||||||
detox-tests: | ||||||
jobs: | ||||||
- detox | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [prettier] reported by reviewdog 🐶
Suggested change
|
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,248 @@ | ||||||||||
name: Run Detox Tests | ||||||||||
on: [pull_request] | ||||||||||
|
||||||||||
jobs: | ||||||||||
find-test-files: | ||||||||||
name: Find Detox test files | ||||||||||
runs-on: macos-latest | ||||||||||
outputs: | ||||||||||
test-files: ${{ steps.set-test-files.outputs.test-files }} | ||||||||||
steps: | ||||||||||
- name: Checkout Code | ||||||||||
uses: actions/checkout@v4 | ||||||||||
|
||||||||||
- name: Find test files | ||||||||||
id: set-test-files | ||||||||||
run: | | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [actionlint] reported by reviewdog 🐶 |
||||||||||
TEST_FILES=$(find example/e2e -name '*.test.js' | sed 's|example/e2e/||g' | jq -R -s -c 'split("\n")[:-1]') | ||||||||||
echo "test-files=$TEST_FILES" >> $GITHUB_OUTPUT | ||||||||||
build-ios: | ||||||||||
name: iOS - Build app for Detox tests | ||||||||||
runs-on: macos-14 | ||||||||||
|
||||||||||
steps: | ||||||||||
- name: Checkout Code | ||||||||||
uses: actions/checkout@v4 | ||||||||||
with: | ||||||||||
fetch-depth: 1 | ||||||||||
|
||||||||||
- name: Setup | ||||||||||
uses: ./.github/actions/setup | ||||||||||
|
||||||||||
- name: Setup Ruby (bundle) | ||||||||||
uses: ruby/setup-ruby@v1 | ||||||||||
with: | ||||||||||
ruby-version: 2.6.10 | ||||||||||
bundler-cache: true | ||||||||||
|
||||||||||
- name: Install ios-deploy, detox, react-native-cli | ||||||||||
run: npm install -g ios-deploy detox-cli react-native-cli | ||||||||||
|
||||||||||
- name: Install Applesimutils | ||||||||||
run: | | ||||||||||
brew tap wix/brew | ||||||||||
brew install applesimutils | ||||||||||
Comment on lines
+43
to
+44
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [prettier] reported by reviewdog 🐶
Suggested change
|
||||||||||
|
||||||||||
- name: Example App Yarn install | ||||||||||
run: | | ||||||||||
cd example | ||||||||||
yarn install --frozen-lockfile | ||||||||||
cd .. | ||||||||||
|
||||||||||
- uses: actions/cache@v4 | ||||||||||
id: cache | ||||||||||
with: | ||||||||||
path: | | ||||||||||
example/ios/Pods | ||||||||||
~/Library/Caches/CocoaPods | ||||||||||
~/.cocoapods | ||||||||||
key: ${{ runner.os }}-pods-${{ hashFiles('example/ios/Podfile.lock') }} | ||||||||||
restore-keys: | | ||||||||||
${{ runner.os }}-pods- | ||||||||||
|
||||||||||
- name: Pod install | ||||||||||
run: | | ||||||||||
cd example/ios | ||||||||||
pod install | ||||||||||
cd ../.. | ||||||||||
|
||||||||||
- name: Build Detox | ||||||||||
run: yarn example detox:ios:build | ||||||||||
|
||||||||||
- name: Upload iOS app | ||||||||||
uses: actions/upload-artifact@v4 | ||||||||||
with: | ||||||||||
name: ios-app-artifact | ||||||||||
path: example/ios/build/Build/Products/Debug-iphonesimulator/ReactNativeSdkExample.app | ||||||||||
retention-days: 1 | ||||||||||
|
||||||||||
build-android: | ||||||||||
name: Android - Build app for Detox tests | ||||||||||
runs-on: ubuntu-latest | ||||||||||
|
||||||||||
steps: | ||||||||||
- name: Checkout Code | ||||||||||
uses: actions/checkout@v4 | ||||||||||
with: | ||||||||||
fetch-depth: 1 | ||||||||||
|
||||||||||
- name: Free Disk Space (Ubuntu) | ||||||||||
uses: jlumbroso/free-disk-space@main | ||||||||||
with: | ||||||||||
tool-cache: true | ||||||||||
android: false | ||||||||||
|
||||||||||
- name: Setup | ||||||||||
uses: ./.github/actions/setup | ||||||||||
|
||||||||||
- name: Setup Java | ||||||||||
uses: actions/setup-java@v4 | ||||||||||
with: | ||||||||||
distribution: zulu | ||||||||||
java-version: 17 | ||||||||||
|
||||||||||
- name: Setup Gradle | ||||||||||
uses: gradle/actions/setup-gradle@v3 | ||||||||||
with: | ||||||||||
gradle-version: wrapper | ||||||||||
cache-read-only: false | ||||||||||
|
||||||||||
- name: Example App Yarn install | ||||||||||
run: | | ||||||||||
cd example | ||||||||||
yarn install | ||||||||||
cd .. | ||||||||||
|
||||||||||
- name: Build Detox | ||||||||||
run: yarn example detox:android:build | ||||||||||
|
||||||||||
- name: Upload Android app | ||||||||||
uses: actions/upload-artifact@v4 | ||||||||||
with: | ||||||||||
name: android-app-artifact | ||||||||||
path: example/android/app/build/outputs/apk | ||||||||||
retention-days: 1 | ||||||||||
|
||||||||||
run-ios-detox-tests: | ||||||||||
needs: [build-ios, find-test-files] | ||||||||||
name: iOS - Run Detox tests | ||||||||||
runs-on: macos-14 | ||||||||||
|
||||||||||
strategy: | ||||||||||
fail-fast: false | ||||||||||
matrix: | ||||||||||
test-file: ${{ fromJson(needs.find-test-files.outputs.test-files) }} | ||||||||||
|
||||||||||
steps: | ||||||||||
- name: Checkout Code | ||||||||||
uses: actions/checkout@v4 | ||||||||||
with: | ||||||||||
fetch-depth: 1 | ||||||||||
|
||||||||||
- name: Download iOS app | ||||||||||
uses: actions/download-artifact@v4 | ||||||||||
with: | ||||||||||
name: ios-app-artifact | ||||||||||
path: example/ios/build/Build/Products/Debug-iphonesimulator/ReactNativeSdkExample.app | ||||||||||
|
||||||||||
- name: Setup | ||||||||||
uses: ./.github/actions/setup | ||||||||||
|
||||||||||
- name: Install ios-deploy, detox, react-native-cli | ||||||||||
run: npm install -g ios-deploy detox-cli react-native-cli | ||||||||||
|
||||||||||
- name: Install Applesimutils | ||||||||||
run: | | ||||||||||
brew tap wix/brew | ||||||||||
brew install applesimutils | ||||||||||
Comment on lines
+156
to
+157
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [prettier] reported by reviewdog 🐶
Suggested change
|
||||||||||
|
||||||||||
- name: Rebuild Detox | ||||||||||
run: | | ||||||||||
cd example | ||||||||||
yarn detox rebuild-framework-cache | ||||||||||
cd .. | ||||||||||
|
||||||||||
- name: Start Metro Server | ||||||||||
env: | ||||||||||
ITBL_API_KEY: ${{secrets.ITERABLE_API_KEY}} | ||||||||||
ITBL_ID: ${{secrets.ITBL_ID}} | ||||||||||
run: cd example && yarn detox:start & | ||||||||||
|
||||||||||
- name: Run Detox tests | ||||||||||
env: | ||||||||||
ITBL_API_KEY: ${{secrets.ITERABLE_API_KEY}} | ||||||||||
ITBL_ID: ${{secrets.ITBL_ID}} | ||||||||||
run: yarn detox:ios:test:ci -- ${{ matrix.test-file }} | ||||||||||
|
||||||||||
- name: Upload Test Artifact - GitHub Action | ||||||||||
if: failure() | ||||||||||
uses: actions/upload-artifact@v4 | ||||||||||
with: | ||||||||||
name: detox-ios-artifacts-${{ matrix.test-file }} | ||||||||||
path: example/artifacts | ||||||||||
retention-days: 1 | ||||||||||
|
||||||||||
run-android-detox-tests: | ||||||||||
needs: [build-android, find-test-files] | ||||||||||
name: Android - Run Detox tests | ||||||||||
runs-on: ubuntu-latest | ||||||||||
|
||||||||||
strategy: | ||||||||||
fail-fast: false | ||||||||||
matrix: | ||||||||||
test-file: ${{ fromJson(needs.find-test-files.outputs.test-files) }} | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [prettier] reported by reviewdog 🐶
Suggested change
|
||||||||||
|
||||||||||
steps: | ||||||||||
- name: Free Disk Space (Ubuntu) | ||||||||||
uses: jlumbroso/free-disk-space@main | ||||||||||
with: | ||||||||||
tool-cache: true | ||||||||||
android: false | ||||||||||
|
||||||||||
- name: Checkout Code | ||||||||||
uses: actions/checkout@v4 | ||||||||||
with: | ||||||||||
fetch-depth: 1 | ||||||||||
|
||||||||||
- name: Download Android app | ||||||||||
uses: actions/download-artifact@v4 | ||||||||||
with: | ||||||||||
name: android-app-artifact | ||||||||||
path: example/android/app/build/outputs/apk | ||||||||||
|
||||||||||
- name: Setup | ||||||||||
uses: ./.github/actions/setup | ||||||||||
|
||||||||||
- name: Start Metro Server | ||||||||||
env: | ||||||||||
ITBL_API_KEY: ${{secrets.ITERABLE_API_KEY}} | ||||||||||
ITBL_ID: ${{secrets.ITBL_ID}} | ||||||||||
run: yarn detox:start & | ||||||||||
|
||||||||||
- name: Enable KVM | ||||||||||
run: | | ||||||||||
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | ||||||||||
sudo udevadm control --reload-rules | ||||||||||
sudo udevadm trigger --name-match=kvm | ||||||||||
|
||||||||||
- name: Run Detox tests | ||||||||||
uses: reactivecircus/android-emulator-runner@v2 | ||||||||||
env: | ||||||||||
ITBL_API_KEY: ${{secrets.ITERABLE_API_KEY}} | ||||||||||
ITBL_ID: ${{secrets.ITBL_ID}} | ||||||||||
with: | ||||||||||
api-level: 31 | ||||||||||
arch: x86_64 | ||||||||||
avd-name: Pixel_3a_API_34 | ||||||||||
force-avd-creation: false | ||||||||||
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -no-metrics | ||||||||||
disable-animations: false | ||||||||||
script: yarn detox:android:test:ci -- ${{ matrix.test-file }} | ||||||||||
|
||||||||||
- name: Upload Test Artifact - GitHub Action | ||||||||||
if: failure() | ||||||||||
uses: actions/upload-artifact@v4 | ||||||||||
with: | ||||||||||
name: detox-android-artifacts-${{ matrix.test-file }} | ||||||||||
path: example/artifacts | ||||||||||
retention-days: 1 | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [prettier] reported by reviewdog 🐶
Suggested change
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[prettier] reported by reviewdog 🐶