Networks healthcheck #4393
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
name: Networks healthcheck | |
on: | |
schedule: | |
- cron: '0 0/4 * * *' | |
workflow_dispatch: | |
pull_request: | |
env: | |
ACALA_PROD_AUTH_TOKEN: 'token' | |
ACALA_TEST_AUTH_TOKEN: 'token' | |
MOONBEAM_PROD_AUTH_TOKEN: 'token' | |
MOONBEAM_TEST_AUTH_TOKEN: 'token' | |
MOONPAY_PRODUCTION_SECRET: 'token' | |
MOONPAY_TEST_SECRET: 'token' | |
MERCURYO_PRODUCTION_SECRET: 'token' | |
MERCURYO_TEST_SECRET: 'token' | |
EHTERSCAN_API_KEY_MOONBEAM: 'token' | |
EHTERSCAN_API_KEY_MOONRIVER: 'token' | |
EHTERSCAN_API_KEY_ETHEREUM: 'token' | |
INFURA_API_KEY: 'token' | |
WALLET_CONNECT_PROJECT_ID: 'token' | |
CI_KEYSTORE_PASS: 'token' | |
CI_KEYSTORE_KEY_ALIAS: 'token' | |
CI_KEYSTORE_KEY_PASS: 'token' | |
TEST_RE_RUNS: 2 | |
TEST_RE_RUNS_DELAY: 15 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
steps: | |
- name: Check out | |
uses: actions/checkout@master | |
with: | |
repository: nova-wallet/nova-wallet-android | |
ref: 'develop' | |
token: ${{ secrets.PAT }} | |
- name: ☕️ Install Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '11' | |
cache: 'gradle' | |
- name: 🏗 Build app for testing | |
run: ./gradlew :app:assembleDebugAndroidTest | |
- name: 🧪 Build instrumential test | |
run: ./gradlew :app:assembleInstrumentialTest | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: apk | |
path: | | |
app/build/outputs/apk/instrumentialTest/ | |
app/build/outputs/apk/androidTest/debug/ | |
android-test: | |
needs: build | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@master | |
- name: Download built artifact | |
uses: actions/download-artifact@v2 | |
with: | |
name: apk | |
path: app | |
- name: Debug | |
run: | | |
ls -R | |
- name: Add permissions | |
run: chmod +x .github/workflows/networks_test.sh | |
- name: Run tests | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
disable-animations: true | |
profile: Nexus 5X | |
api-level: 28 | |
script: .github/workflows/networks_test.sh | |
- uses: actions/upload-artifact@v2 | |
if: always() | |
with: | |
name: anroid-results | |
path: ./allure-results.tar | |
utils-test: | |
name: ${{ matrix.test_path }} | |
runs-on: ubuntu-latest | |
env: | |
PARALLEL_THREADS: 10 # Number or auto | |
strategy: | |
fail-fast: false | |
matrix: | |
test_path: | |
[ | |
"test-nodes-availability", | |
"test-networks-precision", | |
"test-network-chain-id", | |
"test-network-prefix", | |
"test-eth-availability", | |
"test-new-assets" | |
] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Checout to nova-utils | |
uses: actions/checkout@v2 | |
with: | |
repository: nova-wallet/nova-utils | |
ref: master | |
path: nova-utils | |
token: ${{ secrets.PAT }} | |
- name: Debug | |
run: | | |
ls -R | |
shell: bash | |
- name: Set up actual paths | |
uses: ./.github/workflows/setup-path | |
- name: Install dependencies | |
run: | | |
cd ./nova-utils | |
make init | |
- name: Run test | |
continue-on-error: true | |
run: | | |
cd ./nova-utils | |
make ${{ matrix.test_path }} | |
- name: Tar files | |
if: always() | |
run: | | |
cd ./nova-utils | |
tar -cvf allure-results.tar allure-results/ | |
- uses: actions/upload-artifact@v2 | |
if: always() | |
with: | |
name: ${{ matrix.test_path }} | |
path: ./nova-utils/allure-results.tar | |
report: | |
runs-on: ubuntu-latest | |
needs: [android-test, utils-test] | |
if: always() && (needs.build.result == 'success') | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Download built artifact | |
uses: actions/download-artifact@v2 | |
with: | |
path: artifacts | |
- name: Unzip results | |
run: | | |
find artifacts -name allure-results.tar -exec tar -xvf {} \; | |
- uses: ./.github/workflows/report | |
with: | |
secret-token: ${{ secrets.GITHUB_TOKEN }} | |
keep-reports-history: 30 | |
alert: | |
runs-on: ubuntu-latest | |
needs: report | |
if: always() && (needs.android-test.result == 'failure') | |
env: | |
GITHUB_WORKFLOW_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
steps: | |
- name: Report | |
uses: appleboy/telegram-action@master | |
with: | |
to: ${{ secrets.TELEGRAM_TO }} | |
token: ${{ secrets.TELEGRAM_TOKEN }} | |
message: | | |
Network tests failed, lets check: | |
Failed run: | |
${{ env.GITHUB_WORKFLOW_URL }} | |
Report: | |
https://novasamatech.github.io/test-runner/${{ github.run_number }} |