Skip to content

Commit

Permalink
Merge pull request #797 from GetStream/offline-mode
Browse files Browse the repository at this point in the history
feat: Offline support
  • Loading branch information
vishalnarkhede committed Sep 25, 2021
2 parents 3828f4e + 38a8413 commit 6282c48
Show file tree
Hide file tree
Showing 113 changed files with 6,206 additions and 2,410 deletions.
46 changes: 3 additions & 43 deletions .detoxrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,6 @@
"runnerConfig": "e2e/config.json",
"skipLegacyWorkersInjection": true,
"apps": {
"ios.native.debug": {
"name": "iOS NativeMessaging Debug",
"type": "ios.app",
"binaryPath": "examples/NativeMessaging/ios/build/Build/Products/Debug-iphonesimulator/NativeMessaging.app",
"build": "cd examples/NativeMessaging && xcodebuild -workspace ios/NativeMessaging.xcworkspace -scheme NativeMessaging -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build"
},
"ios.native.release": {
"name": "iOS NativeMessaging Release",
"type": "ios.app",
"binaryPath": "examples/NativeMessaging/ios/build/Build/Products/Release-iphonesimulator/NativeMessaging.app",
"build": "cd examples/NativeMessaging && xcodebuild -workspace ios/NativeMessaging.xcworkspace -scheme NativeMessaging -configuration Release -sdk iphonesimulator -derivedDataPath ios/build"
},
"android.native.debug": {
"name": "Android NativeMessaging Debug",
"type": "android.apk",
"binaryPath": "examples/NativeMessaging/android/app/build/outputs/apk/debug/app-debug.apk",
"build": "cd examples/NativeMessaging/android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug"
},
"android.native.release": {
"name": "Android NativeMessaging Release",
"type": "android.apk",
"binaryPath": "examples/NativeMessaging/android/app/build/outputs/apk/release/app-release.apk",
"build": "cd examples/NativeMessaging/android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release"
},
"ios.sample.debug": {
"name": "iOS SampleApp Debug",
"type": "ios.app",
Expand All @@ -42,8 +18,8 @@
"android.sample.debug": {
"name": "Android SampleApp Debug",
"type": "android.apk",
"binaryPath": "examples/SampleApp/android/app/build/outputs/apk/release/app-release.apk",
"build": "cd examples/SampleApp/android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=debug"
"binaryPath": "examples/SampleApp/android/app/build/outputs/apk/debug/app-debug.apk",
"build": "cd examples/SampleApp/android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug"
},
"android.sample.release": {
"name": "Android SampleApp Release",
Expand All @@ -62,27 +38,11 @@
"emulator": {
"type": "android.emulator",
"device": {
"avdName": "Pixel4"
"avdName": "Pixel_29_AOSP"
}
}
},
"configurations": {
"ios.native.debug": {
"device": "simulator",
"app": "ios.native.debug"
},
"ios.native.release": {
"device": "simulator",
"app": "ios.native.release"
},
"android.native.debug": {
"device": "emulator",
"app": "android.native.debug"
},
"android.native.release": {
"device": "emulator",
"app": "android.native.release"
},
"ios.sample.debug": {
"device": "simulator",
"app": "ios.sample.debug"
Expand Down
36 changes: 0 additions & 36 deletions .github/workflows/e2e-native-android.yml

This file was deleted.

31 changes: 0 additions & 31 deletions .github/workflows/e2e-native-ios.yml

This file was deleted.

65 changes: 54 additions & 11 deletions .github/workflows/e2e-sample-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,69 @@ on:
jobs:
test:
runs-on: macos-latest

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Installation & Build Package
# installation already takes care of calling prepare which calls build
# for the sdk package
run: yarn --frozen-lockfile && yarn bootstrap-ci
- name: Install Java JDK

- name: Install node_modules
uses: nick-invision/retry@v2
with:
timeout_minutes: 10
max_attempts: 3
command: yarn --frozen-lockfile && yarn bootstrap-ci

- name: Use specific Java version for sdkmanager to work
uses: joschi/setup-jdk@v2
with:
java-version: '11'
- name: Build
java-version: 'openjdk8'
architecture: 'x64'

- name: Build Android App
continue-on-error: true
id: buildApp
run: yarn detox-sample-android:build

- name: Build Android App retry
if: failure() && steps.buildApp.outcome == 'failure'
run: yarn detox-sample-android:build
- name: Test

- name: Run tests
id: runTests
continue-on-error: true
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
target: google_apis
avd-name: Pixel4
script: yarn detox-sample-android:test
ram-size: 4000
avd-name: Pixel_29_AOSP
disable-animations: true
disable-spellchecker: true
target: default
emulator-build: 7425822 # https://github.com/ReactiveCircus/android-emulator-runner/issues/160
emulator-options: -gpu swiftshader_indirect -no-audio -no-snapshot -no-window -no-boot-anim -camera-back none
script: yarn detox-sample-android:test --record-logs failing --record-videos failing

- name: Run tests retry
id: runTests2
if: steps.runTests.outcome == 'failure'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
ram-size: 4000
avd-name: Pixel_29_AOSP
force-avd-creation: false
disable-animations: true
disable-spellchecker: true
target: default
emulator-build: 7425822 # https://github.com/ReactiveCircus/android-emulator-runner/issues/160
emulator-options: -gpu swiftshader_indirect -no-audio -no-snapshot -no-window -no-boot-anim -camera-back none
script: yarn detox-sample-android:test --record-logs failing --record-videos failing

- uses: actions/upload-artifact@v2
if: failure() && steps.runTests2.outcome == 'failure'
with:
name: detox-artifacts
path: ./artifacts
25 changes: 20 additions & 5 deletions .github/workflows/e2e-sample-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,38 @@ on:
jobs:
test:
runs-on: macos-latest

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Installation & Build Package
# installation already takes care of calling prepare which calls build
# for the sdk package
run: yarn --frozen-lockfile && yarn bootstrap-ci

- name: Install node_modules
uses: nick-invision/retry@v2
with:
timeout_minutes: 10
max_attempts: 3
command: yarn --frozen-lockfile && yarn bootstrap-ci

- name: Install Pods
run: cd ./examples/SampleApp && npx pod-install
- name: Install Detox Dependencies
run: |
brew tap wix/brew
brew install applesimutils
xcrun simctl list
- name: Build
run: yarn detox-sample-ios:build

- name: Test
run: yarn detox-sample-ios:test
id: detoxRun
run: FORCE_IOS_OFFLINE=true yarn detox-sample-ios:test --record-logs failing --record-videos failing

- uses: actions/upload-artifact@v2
if: failure() && steps.detoxRun.outcome == 'failure'
with:
name: detox-artifacts
path: ./artifacts
11 changes: 7 additions & 4 deletions .github/workflows/legacy-sample-distribution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ name: legacy-sample-distribution
on:
push:
branches:
- develop
- v4.0.0
paths:
- examples/SampleApp
- examples/SampleApp
- package
jobs:
build_and_deploy_ios_firebase:
runs-on: [macos-latest]
Expand All @@ -19,10 +20,11 @@ jobs:
run: npm install -g firebase-tools
- name: RN setup
run: |
cd package
yarn;
cd native-package
yarn;
cd ../examples/SampleApp
cd ../../examples/SampleApp
yarn;
cd ios
pod install
Expand All @@ -45,10 +47,11 @@ jobs:
- name: RN setup
run: |
yarn add global react-native-cli;
cd package
yarn;
cd native-package
yarn;
cd ../examples/SampleApp
cd ../../examples/SampleApp
yarn;
- name: Build
run: |
Expand Down
39 changes: 23 additions & 16 deletions .github/workflows/sample-distribution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ name: sample-distribution
on:
push:
branches:
- develop
- v4.0.0
paths:
- examples/SampleApp
- package
jobs:
build_and_deploy_ios_testflight_qa:
runs-on: [macos-latest]
Expand All @@ -18,14 +19,17 @@ jobs:
cd examples/SampleApp/ios
bundle update --bundler
- name: RN setup
run: |
yarn;
cd native-package
yarn;
cd ../examples/SampleApp
yarn;
cd ios
pod install
uses: nick-invision/retry@v2
with:
timeout_minutes: 10
max_attempts: 3
command: |
yarn && yarn bootstrap-ci;
cd package/native-package
yarn;
cd ../../examples/SampleApp
cd ios
pod install
- name: Build and release Testflight QA
env:
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
Expand All @@ -45,13 +49,15 @@ jobs:
with:
java-version: 1.8
- name: RN setup
run: |
yarn add global react-native-cli;
yarn;
cd native-package
yarn;
cd ../examples/SampleApp
yarn;
uses: nick-invision/retry@v2
with:
timeout_minutes: 10
max_attempts: 3
command: |
yarn add global react-native-cli;
yarn && yarn bootstrap-ci;
cd package/native-package
yarn;
- name: Build
run: |
cd examples/SampleApp
Expand All @@ -68,6 +74,7 @@ jobs:
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Upload APK
# https://getstream.io/downloads/rn-sample-app.apk
run: |
cp examples/SampleApp/android/app/build/outputs/apk/release/app-release.apk rn-sample-app.apk
aws s3 cp rn-sample-app.apk s3://${{ secrets.AWS_S3_BUCKET }} --sse AES256
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
node_modules
NEXT_RELEASE_CHANGELOG.md
NEXT_RELEASE_CHANGELOG.md
artifacts
e2e/.env
Loading

0 comments on commit 6282c48

Please sign in to comment.