-
Notifications
You must be signed in to change notification settings - Fork 21
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
70b747c
commit d404e5d
Showing
16 changed files
with
282 additions
and
41 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
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,101 @@ | ||
name: e2e-android | ||
|
||
on: pull_request | ||
|
||
env: | ||
E2E_TESTS: 1 # build without transform-remove-console babel plugin | ||
DEBUG: 'lnurl* lnurl server' | ||
|
||
jobs: | ||
e2e: | ||
runs-on: macos-12 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 1 | ||
|
||
- name: Setup Docker Colima 1 | ||
uses: douglascamata/setup-docker-macos-action@v1-alpha | ||
id: docker1 | ||
continue-on-error: true | ||
|
||
- name: Setup Docker Colima 2 | ||
if: steps.docker1.outcome != 'success' | ||
uses: douglascamata/setup-docker-macos-action@v1-alpha | ||
# id: docker2 | ||
# continue-on-error: true | ||
|
||
# - name: Setup Docker Default | ||
# # if: steps.docker1.outcome != 'success' && steps.docker2.outcome != 'success' | ||
# uses: docker-practice/[email protected] | ||
# timeout-minutes: 30 | ||
|
||
- name: Run regtest setup | ||
run: cd docker && mkdir lnd && chmod 777 lnd && docker-compose up -d | ||
|
||
- name: Wait for bitcoind | ||
timeout-minutes: 2 | ||
run: while ! nc -z '127.0.0.1' 43782; do sleep 1; done | ||
|
||
- name: Wait for electrum server | ||
timeout-minutes: 2 | ||
run: while ! nc -z '127.0.0.1' 60001; do sleep 1; done | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.17 | ||
cache: 'yarn' # cache packages, but not node_modules | ||
|
||
- name: Activate enviroment variables | ||
run: cp .env.test.template .env | ||
|
||
- name: Activate react-native-skia-stub | ||
run: patch -p1 < .github/workflows/react-native-skia-stub.patch | ||
|
||
- name: Activate Gradle variables | ||
run: cp .github/workflows/gradle.properties ~/.gradle/gradle.properties | ||
|
||
- name: Use specific Java version for sdkmanager to work | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
|
||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
|
||
- name: Yarn Install | ||
run: yarn --no-audit --prefer-offline || yarn --no-audit --prefer-offline | ||
env: | ||
HUSKY: 0 | ||
|
||
- name: Build | ||
run: yarn e2e:build:android-release || yarn e2e:build:android-release | ||
|
||
- name: Test | ||
uses: reactivecircus/android-emulator-runner@v2 | ||
with: | ||
api-level: 31 | ||
profile: 5.4in FWVGA | ||
avd-name: Pixel_API_31_AOSP | ||
force-avd-creation: false | ||
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-back none -camera-front none -partition-size 2047 | ||
arch: x86_64 | ||
script: | | ||
yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all || \ | ||
yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all || \ | ||
yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all || \ | ||
yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all | ||
- uses: actions/upload-artifact@v3 | ||
if: failure() | ||
with: | ||
name: e2e-test-videos | ||
path: ./artifacts/ | ||
|
||
- name: Dump docker logs on failure | ||
if: failure() | ||
uses: jwalton/gh-docker-logs@v2 |
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,4 @@ | ||
BITKIT_UPLOAD_STORE_FILE=debug.keystore | ||
BITKIT_UPLOAD_STORE_PASSWORD=android | ||
BITKIT_UPLOAD_KEY_ALIAS=androiddebugkey | ||
BITKIT_UPLOAD_KEY_PASSWORD=android |
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
29 changes: 29 additions & 0 deletions
29
android/app/src/androidTest/java/com/bitkit/DetoxTest.java
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,29 @@ | ||
package com.bitkit; | ||
|
||
import com.wix.detox.Detox; | ||
import com.wix.detox.config.DetoxConfig; | ||
|
||
import org.junit.Rule; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
import androidx.test.ext.junit.runners.AndroidJUnit4; | ||
import androidx.test.filters.LargeTest; | ||
import androidx.test.rule.ActivityTestRule; | ||
|
||
@RunWith(AndroidJUnit4.class) | ||
@LargeTest | ||
public class DetoxTest { | ||
@Rule | ||
public ActivityTestRule<MainActivity> mActivityRule = new ActivityTestRule<>(MainActivity.class, false, false); | ||
|
||
@Test | ||
public void runDetoxTests() { | ||
DetoxConfig detoxConfig = new DetoxConfig(); | ||
detoxConfig.idlePolicyConfig.masterTimeoutSec = 90; | ||
detoxConfig.idlePolicyConfig.idleResourceTimeoutSec = 60; | ||
detoxConfig.rnContextLoadTimeoutSec = (BuildConfig.DEBUG ? 180 : 60); | ||
|
||
Detox.runTests(mActivityRule, detoxConfig); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<network-security-config> | ||
<domain-config cleartextTrafficPermitted="true"> | ||
<domain includeSubdomains="true">10.0.2.2</domain> | ||
<domain includeSubdomains="true">localhost</domain> | ||
</domain-config> | ||
</network-security-config> |
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.