Skip to content

Commit

Permalink
Merge pull request #101 from XRPL-Labs/develop
Browse files Browse the repository at this point in the history
v3.0.0
  • Loading branch information
N3TC4T authored Sep 24, 2024
2 parents e6b13d8 + fb8d6e0 commit 580497f
Show file tree
Hide file tree
Showing 1,236 changed files with 37,756 additions and 20,829 deletions.
39 changes: 18 additions & 21 deletions .detoxrc.js
Original file line number Diff line number Diff line change
@@ -1,48 +1,45 @@
module.exports = {
apps: {
'ios.debug': {
type: 'ios.app',
binaryPath: 'ios/build/Build/Products/Debug-iphonesimulator/Xaman.app',
build: 'xcodebuild -workspace ios/Xaman.xcworkspace -scheme Xaman -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build',
},
'ios.release': {
'xaman.ios': {
type: 'ios.app',
binaryPath: 'ios/build/Build/Products/Release-iphonesimulator/Xaman.app',
build: 'xcodebuild -workspace ios/Xaman.xcworkspace -scheme Xaman -configuration Release -sdk iphonesimulator -derivedDataPath ios/build',
},
'android.debug': {
type: 'android.apk',
binaryPath: 'android/app/build/outputs/apk/debug/app-debug.apk',
build: 'cd android && ./gradlew app:assembleDebug app:assembleAndroidTest -DtestBuildType=debug && cd ..',
},
'android.release': {
'xaman.android': {
type: 'android.apk',
binaryPath: 'android/app/build/outputs/apk/release/app-release.apk',
binaryPath: 'android/app/build/outputs/apk/release/app-x86_64-release.apk',
build: 'cd android && ./gradlew app:assembleRelease app:assembleAndroidTest -DtestBuildType=release && cd ..',
},
},
devices: {
'ios.simulator': {
type: 'ios.simulator',
headless: process.env.CI ? true : undefined,
device: { type: 'iPhone 15 Pro' },
},
'android.emulator': {
type: 'android.apk',
device: { avdName: 'Nexus_5X_API_28' },
},
'android.attached': {
type: 'android.attached',
device: {
adbName: '.*',
},
},
},
configurations: {
'ios.sim.debug': {
device: 'ios.simulator',
app: 'ios.debug',
},
'ios.sim.release': {
'ios.simulator+xaman.ios': {
device: 'ios.simulator',
app: 'ios.release',
app: 'xaman.ios',
},
'android.emu.debug': {
'android.emulator+xaman.android': {
device: 'android.emulator',
app: 'android.debug',
app: 'xaman.android',
},
'android.attached+xaman.android': {
device: 'android.attached',
app: 'xaman.android',
},
},
};
39 changes: 7 additions & 32 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
"@typescript-eslint",
"react-native",
"prettier",
"jest",
"spellcheck"
"jest"
],
"extends": [
"airbnb",
Expand Down Expand Up @@ -57,10 +56,13 @@
"arrow-body-style": 0,
"max-len": [2, {"code": 120, "tabWidth": 4, "ignoreUrls": true, "ignoreTemplateLiterals": true }],
"quotes": ["error", "single"],
"semi": ["error", "always"],
"semi": "off",
"@typescript-eslint/semi": "error",
"@typescript-eslint/member-delimiter-style": "error",
// "@typescript-eslint/no-explicit-any": "error",
"curly": [2, "multi-line"],
"comma-dangle": [2, "always-multiline"],
"class-methods-use-this": ["error", {"enforceForClassFields": false, "exceptMethods": ["startApp", "componentDidMount", "componentWillUnmount", "render"] }],
"class-methods-use-this": ["off", {"enforceForClassFields": false, "exceptMethods": ["startApp", "componentDidMount", "componentWillUnmount", "render"] }],
"global-require": 0,
"quote-props": 0,
"lines-between-class-members": "off",
Expand Down Expand Up @@ -132,33 +134,6 @@
"jest/no-disabled-tests": 1,
"jest/no-focused-tests": 2,
"jest/no-identical-title": 2,
"react/no-unused-class-component-methods": 0,
"spellcheck/spell-checker": [1, {
"comments": true,
"strings": true,
"identifiers": true,
"lang": "en_US",
"skipWords": [
"eslint", "redux", "middleware", "destructuring", "async", "lodash", "libs", "Backend", "istanbul", "rehydrate", "linebreak",
"decrypt", "Keychain", "passphrase", "nonexist", "js", "Crashlytics", "Analytics", "init", "Onboarding", "middlewares",
"firebase", "ios", "const", "renderer", "dev", "fallbacks", "Utils", "sha512", "sha256", "sha1", "fn", "ja", "cn", "auth",
"cb", "loggin", "api", "src", "biometric", "Biometry", "rtl", "grey", "Unmount", "passcode", "Selectable", "png", "xrpl", "accountlib",
"Prev", "orm", "reselect", "keypair", "readonly", "uuid", "uuidv4", "desc", "sml", "wss", "altnet", "rippletest", "ws", "args",
"tx", "namespace", "bignumber", "Xrp", "counterparty", "str", "params", "req", "eg", "param", "timestamp", "idempotency", "Num", "testnet",
"utf", "xumm", "netinfo", "uri", "Interactable", "bool", "schemas", "Ious", "upsert", "Trustline", "rpepoch", "unix", "iso8601", "ecrypt",
"privatekey", "multisign", "tes", "Reactotron", "resize", "Interitem", "multisigned", "txid", "rgba", "jsx", "uint8", "img", "btn", "pbold",
"Devnet", "Mainnet", "Swiper", "calc", "abcdefgh", "cancelable", "uniqBy", "memoize", "Memoized", "html", "len", "fg", "bg", "ctx", "checksum",
"ecc", "uniq", "Truthy", "Responder", "ter", "ko", "zh", "mailto", "tabbar", "https", "gcm", "tf", "xlight", "aps", "tec", "barcodes", "Barcode",
"txblob", "tos", "gif", "ic", "asf", "ok", "Sig", "haptic", "Signable", "Unauthorize", "Preauth", "payid", "Biometrics", "Towo", "tz", "xrpscan",
"xrplorer", "bithomp", "xpring", "xrplns", "Pincode", "Txn", "iap", "Realtime", "datastore", "decrypted", "Tangem", "Sdk", "Secp256k1", "blockchain",
"Escrowed", "xapp", "Veriff", "Codec", "xapps", "Pressable", "nft", "ott", "Luminance", "HexToRgbA", "Misconfiguration", "kyc", "debounce", "debounced",
"nfc", "lsf", "nfts", "Taxon", "fioprotocol", "iou", "dy", "vy", "pb", "nf", "origintype", "Xaman", "xls20", "livenet", "feeunits", "Preflight", "ctid",
"explainer", "Cancelled", "nftoken", "Remint", "amm"
],
"skipIfMatch": [
"http://[^s]*",
"^[-\\w]+\/[-\\w\\.]+$"
]
}]
"react/no-unused-class-component-methods": 0
}
}
20 changes: 20 additions & 0 deletions .github/actions/prepare-cocoapods/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: prepare-cocoapods
description: Prepare Cocoapods

runs:
using: composite
steps:
- name: Cache Pods
uses: actions/cache@v4
id: podcache
with:
path: ios/Pods
key: pods-${{ hashFiles('**/Podfile.lock') }}

- name: Install Pods dependencies
env:
LC_ALL: en_US.UTF-8
shell: bash
run: |
cd ios && \
pod install --repo-update
39 changes: 39 additions & 0 deletions .github/actions/prepare-env/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: prepare-environment
description: Prepare development environment

inputs:
cocoapods:
description: 'Setup env with cocoapods'
required: false
default: 'false'

runs:
using: composite
steps:
- name: Node
uses: actions/setup-node@v4
with:
node-version: 18.x

- name: Cache node_modules/
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.OS }}-npm-cache-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-npm-cache-
- name: Install Node dependencies
shell: bash
run: npm ci

- name: Prepare cocoapods
if: "${{ inputs.cocoapods == 'true' }}"
uses: ./.github/actions/prepare-cocoapods

- name: Prepare source code
shell: bash
run: |
./scripts/build-env.sh
mv src/app.tsx src/app.tsx.old && cat src/app.tsx.old|perl -pe'BEGIN{undef $/;} s/if \(isJailBroken.+?}/\/\/ No root or jailbreak detection/gms' > src/app.tsx
62 changes: 62 additions & 0 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: android
env:
CI: true

on:
push:
branches: [ master ]
pull_request:
branches: [ develop, master ]

jobs:
build-test:
if: github.event.pull_request.draft == false
runs-on: [ self-hosted, macOS, ARM64 ]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Prepare Environment
uses: ./.github/actions/prepare-env

- name: Get version details from build.gradle
run: |
VERSION_CODE=$(awk -F'=' '/canonicalVersionCode/ {print $2; exit}' android/app/build.gradle | tr -d ' ')
VERSION_NAME=$(awk -F'=' '/canonicalVersionName/ {print $2; exit}' android/app/build.gradle | tr -d ' ' | tr -d '"')
echo "VERSION_CODE=$VERSION_CODE" >> $GITHUB_ENV
echo "VERSION_NAME=$VERSION_NAME" >> $GITHUB_ENV
echo "TIMESTAMP=$(date +%s)" >> $GITHUB_ENV
- name: Build tests
working-directory: android
run: ./gradlew app:assembleAndroidTest

- name: Run tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 34
avd-name: ci-actions-avd
target: google_apis
arch: arm64-v8a
ndk: 25.1.8937393
cmake: 3.18.1
script: cd android; ./gradlew app:connectedAndroidTest -Pandroid.testInstrumentationRunnerArguments.notClass=com.xrpllabs.xumm.DetoxTest --info

- name: Test Summary
uses: test-summary/action@dist
with:
paths: android/app/build/outputs/androidTest-results/connected/**/*.xml
show: "all"
if: always()

- name: Build APK
working-directory: android
run: ./gradlew app:assembleRelease --quiet

- name: Upload APK dev release
uses: actions/upload-artifact@v4
with:
name: ${{ env.TIMESTAMP }}_Xaman_${{ env.VERSION_NAME }}_${{ env.VERSION_CODE }} APK(s)
path: android/app/build/outputs/apk/release/
74 changes: 24 additions & 50 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -1,70 +1,44 @@
name: e2e
env:
CI: true
DETOX_CONFIGURATION: ios.simulator+xaman.ios

on: [pull_request]
on:
push:
branches: [ master ]
pull_request:
branches: [ develop, master ]

jobs:
build-run:
if: "contains(github.event.commits[0].message, '[include e2e]')"
runs-on: macos-11
build-test:
if: github.event.pull_request.draft == false
runs-on: [ self-hosted, macOS, ARM64 ]

steps:
- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@v1.1
with:
xcode-version: latest-stable

- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Node
uses: actions/setup-node@v1
with:
node-version: 18.x

- run: node --version

- name: Cache node modules
uses: actions/cache@v1
id: cache
- name: Prepare Environment
uses: ./.github/actions/prepare-env
with:
path: node_modules
key: node-modules-${{ hashFiles('**/package-lock.json') }}
cocoapods: 'true'

- name: Rebuild detox
if: steps.cache.outputs.cache-hit == 'true'
run: npx detox clean-framework-cache && npx detox build-framework-cache

- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci

- name: Cache Pods
uses: actions/cache@v1
id: podcache
with:
path: ios/Pods
key: pods-${{ hashFiles('**/Podfile.lock') }}

- name: Update Pods
run: |
gem update cocoapods xcodeproj
cd ios && pod install && cd ..
- name: Prepare
run: |
brew tap wix/brew
brew install applesimutils
make build-env
make generate-locales
mv src/app.tsx src/app.tsx.old && cat src/app.tsx.old|perl -pe'BEGIN{undef $/;} s/if \(isJailBroken.+?}/\/\/ No root or jailbreak detection/gms' > src/app.tsx
npx detox clean-framework-cache
npx detox build-framework-cache
- name: Build app for detox
run: npx detox build e2e --configuration ${DETOX_CONFIGURATION} --if-missing

- run: npx detox build e2e --configuration ios.sim.release
- run: npx cucumber-js ./e2e --configuration ios.sim.release
- name: Run e2e tests
run: npx cucumber-js ./e2e test

- name: Upload artifact files
if: ${{ always() }}
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: artifact
name: e2e artifact
path: e2e/artifacts/
38 changes: 38 additions & 0 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: ios
env:
CI: true

on:
push:
branches: [ master ]
pull_request:
branches: [ develop, master ]

jobs:
build-test:
if: github.event.pull_request.draft == false
runs-on: [ self-hosted, macOS, ARM64 ]
strategy:
matrix:
ios: [ 17.4 ]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Prepare Environment
uses: ./.github/actions/prepare-env
with:
cocoapods: 'true'

- name: Run tests
working-directory: ios
run: |
xcodebuild -quiet -workspace Xaman.xcworkspace -scheme Xaman -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 15,OS=${{ matrix.ios }}' -resultBundlePath TestResults test
- name: Test Summary
uses: kishikawakatsumi/xcresulttool@v1
with:
path: ios/TestResults.xcresult
if: success() || failure()
Loading

0 comments on commit 580497f

Please sign in to comment.