mirror of
https://github.com/pezkuwichain/pezkuwi-wallet-android.git
synced 2026-04-22 20:47:56 +00:00
Initial commit: Pezkuwi Wallet Android
Complete rebrand of Nova Wallet for Pezkuwichain ecosystem. ## Features - Full Pezkuwichain support (HEZ & PEZ tokens) - Polkadot ecosystem compatibility - Staking, Governance, DeFi, NFTs - XCM cross-chain transfers - Hardware wallet support (Ledger, Polkadot Vault) - WalletConnect v2 - Push notifications ## Languages - English, Turkish, Kurmanci (Kurdish), Spanish, French, German, Russian, Japanese, Chinese, Korean, Portuguese, Vietnamese Based on Nova Wallet by Novasama Technologies GmbH © Dijital Kurdistan Tech Institute 2026
This commit is contained in:
Executable
+72
@@ -0,0 +1,72 @@
|
||||
import os
|
||||
import sys
|
||||
import re
|
||||
from datetime import datetime, timezone
|
||||
import requests
|
||||
|
||||
|
||||
ALLOWED_SEVERITIES = {"Major", "Critical", "Normal"}
|
||||
|
||||
# Matches: "Release severity: <value>" (case-insensitive, flexible spaces)
|
||||
SEVERITY_LINE_RE = re.compile(r"^release\s+severity\s*:\s*(.+)$", re.IGNORECASE)
|
||||
|
||||
|
||||
def parse_base_params(comment_link: str) -> None:
|
||||
if not comment_link:
|
||||
print("COMMENT_LINK is not set. Provide a valid PR comment API URL in env var COMMENT_LINK.")
|
||||
sys.exit(1)
|
||||
|
||||
env_file = os.getenv("GITHUB_ENV")
|
||||
if not env_file:
|
||||
print("GITHUB_ENV is not set. This script expects GitHub Actions environment.")
|
||||
sys.exit(1)
|
||||
|
||||
try:
|
||||
resp = requests.get(comment_link, timeout=10)
|
||||
resp.raise_for_status()
|
||||
payload = resp.json()
|
||||
except requests.RequestException as e:
|
||||
print(f"Failed to fetch PR comment: {e}")
|
||||
sys.exit(1)
|
||||
except ValueError:
|
||||
print("Response is not valid JSON.")
|
||||
sys.exit(1)
|
||||
|
||||
body = payload.get("body")
|
||||
if not isinstance(body, str) or not body.strip():
|
||||
print("PR comment body is empty. Add 'Release severity: Major | Critical | Normal'.")
|
||||
sys.exit(1)
|
||||
|
||||
lines = [line.strip() for line in body.splitlines()]
|
||||
|
||||
severity_raw = ""
|
||||
|
||||
for line in lines:
|
||||
m = SEVERITY_LINE_RE.match(line)
|
||||
if m:
|
||||
severity_raw = m.group(1).strip()
|
||||
break
|
||||
|
||||
if not severity_raw:
|
||||
print("Release severity is missing. Add a line 'Release severity: Major | Critical | Normal'.")
|
||||
sys.exit(1)
|
||||
|
||||
if severity_raw not in ALLOWED_SEVERITIES:
|
||||
print(f"Invalid severity '{severity_raw}'. Allowed values: Major, Critical, Normal.")
|
||||
sys.exit(1)
|
||||
|
||||
severity = severity_raw
|
||||
|
||||
time_iso = datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ")
|
||||
|
||||
try:
|
||||
with open(env_file, "a", encoding="utf-8") as f:
|
||||
f.write(f"TIME={time_iso}\n")
|
||||
f.write(f"SEVERITY={severity}\n")
|
||||
except OSError as e:
|
||||
print(f"Failed to write to GITHUB_ENV: {e}")
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
parse_base_params(os.getenv("COMMENT_LINK"))
|
||||
@@ -0,0 +1,52 @@
|
||||
#!/usr/bin/env bash
|
||||
adb devices
|
||||
|
||||
# Install debug app
|
||||
adb -s emulator-5554 install app/debug/app-debug.apk
|
||||
|
||||
# Install instrumental tests
|
||||
adb -s emulator-5554 install app/androidTest/debug/app-debug-androidTest.apk
|
||||
|
||||
# Run tests
|
||||
adb logcat -c &&
|
||||
python - <<END
|
||||
import os
|
||||
import re
|
||||
import subprocess as sp
|
||||
import sys
|
||||
import threading
|
||||
import time
|
||||
|
||||
done = False
|
||||
def update():
|
||||
# prevent CI from killing the process for inactivity
|
||||
while not done:
|
||||
time.sleep(5)
|
||||
print ("Running...")
|
||||
t = threading.Thread(target=update)
|
||||
t.dameon = True
|
||||
t.start()
|
||||
def run():
|
||||
os.system('adb wait-for-device')
|
||||
p = sp.Popen('adb shell am instrument -w -m -e debug false -e class "io.novafoundation.nova.balances.BalancesIntegrationTest" io.novafoundation.nova.debug.test/io.qameta.allure.android.runners.AllureAndroidJUnitRunner',
|
||||
shell=True, stdout=sp.PIPE, stderr=sp.PIPE, stdin=sp.PIPE)
|
||||
return p.communicate()
|
||||
success = re.compile(r'OK \(\d+ tests\)')
|
||||
stdout, stderr = run()
|
||||
stdout = stdout.decode('ISO-8859-1')
|
||||
stderr = stderr.decode('ISO-8859-1')
|
||||
done = True
|
||||
print (stderr)
|
||||
print (stdout)
|
||||
if success.search(stderr + stdout):
|
||||
sys.exit(0)
|
||||
else:
|
||||
sys.exit(1) # make sure we fail if the tests fail
|
||||
END
|
||||
EXIT_CODE=$?
|
||||
adb logcat -d '*:E'
|
||||
|
||||
# Export results
|
||||
adb exec-out run-as io.novafoundation.nova.debug sh -c 'cd /data/data/io.novafoundation.nova.debug/files && tar cf - allure-results' > allure-results.tar
|
||||
|
||||
exit $EXIT_CODE
|
||||
@@ -0,0 +1,52 @@
|
||||
#!/usr/bin/env bash
|
||||
adb devices
|
||||
|
||||
# Install debug app
|
||||
adb -s emulator-5554 install app/debug/app-debug.apk
|
||||
|
||||
# Install instrumental tests
|
||||
adb -s emulator-5554 install test-app/androidTest/debug/app-debug-androidTest.apk
|
||||
|
||||
# Run tests
|
||||
adb logcat -c &&
|
||||
python - <<END
|
||||
import os
|
||||
import re
|
||||
import subprocess as sp
|
||||
import sys
|
||||
import threading
|
||||
import time
|
||||
|
||||
done = False
|
||||
def update():
|
||||
# prevent CI from killing the process for inactivity
|
||||
while not done:
|
||||
time.sleep(5)
|
||||
print ("Running...")
|
||||
t = threading.Thread(target=update)
|
||||
t.dameon = True
|
||||
t.start()
|
||||
def run():
|
||||
os.system('adb wait-for-device')
|
||||
p = sp.Popen('adb shell am instrument -w -m -e notClass io.novafoundation.nova.balances.BalancesIntegrationTest -e package io.novafoundation.nova.debug io.novafoundation.nova.debug.test/io.qameta.allure.android.runners.AllureAndroidJUnitRunner',
|
||||
shell=True, stdout=sp.PIPE, stderr=sp.PIPE, stdin=sp.PIPE)
|
||||
return p.communicate()
|
||||
success = re.compile(r'OK \(\d+ tests\)')
|
||||
stdout, stderr = run()
|
||||
stdout = stdout.decode('ISO-8859-1')
|
||||
stderr = stderr.decode('ISO-8859-1')
|
||||
done = True
|
||||
print (stderr)
|
||||
print (stdout)
|
||||
if success.search(stderr + stdout):
|
||||
sys.exit(0)
|
||||
else:
|
||||
sys.exit(1) # make sure we fail if the tests fail
|
||||
END
|
||||
EXIT_CODE=$?
|
||||
adb logcat -d '*:E'
|
||||
|
||||
# Export results
|
||||
adb exec-out run-as io.novafoundation.nova.debug sh -c 'cd /data/data/io.novafoundation.nova.debug/files && tar cf - allure-results' > allure-results.tar
|
||||
|
||||
exit $EXIT_CODE
|
||||
Reference in New Issue
Block a user