Skip to content

feat/253 Implement ledger service in Extension #1128

feat/253 Implement ledger service in Extension

feat/253 Implement ledger service in Extension #1128

name: Deploy wallet preview to netlify at PR and pushes to it
on:
pull_request:
paths:
- "apps/namada-interface/**"
- "apps/extension/**"
- "packages/integrations/**"
- "packages/rpc/**"
- "packages/shared/**"
- "packages/tx/**"
- "packages/utils/**"
- "packages/wallet/**"
- "packages/wasm/**"
- ".github/workflows/**"
env:
CI: false
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install dependencies
run: yarn
- name: Run ESLint
run: yarn lint:ci
unit-tests-js:
needs: lint
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install protoc
run: sudo apt-get install -y protobuf-compiler
- name: Install dependencies
run: yarn
- name: Install wasm-pack
uses: jetli/[email protected]
with:
version: "v0.10.3"
- name: Compile WASM
run: yarn wasm:build-test
- name: Run unit tests
id: run-unit-tests
run: yarn test:ci
- name: Report success
if: steps.run-unit-tests.outcome == 'success'
run: |
curl --header "Content-Type: application/json" \
--request POST \
--data '{"message":"Unit tests succeeded ✅\n \n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\n \nReview\nhttps://pull-request-${{ github.event.number }}--wallet-development-heliax-dev.netlify.app\n \nthe PR\nhttps://github.com/anoma/namada-interface/pull/${{ github.event.number }}"}' \
${{ secrets.SLACK_WEBHOOK_WALLET_PR }}
- name: Report failure
if: steps.run-unit-tests.outcome != 'success'
run: |
curl --header "Content-Type: application/json" \
--request POST \
--data '{"message":"Unit tests failed ⛔️ \n \n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\n \nReview\nhttps://pull-request-${{ github.event.number }}--wallet-development-heliax-dev.netlify.app\n \nthe PR\nhttps://github.com/anoma/namada-interface/pull/${{ github.event.number }}"}' \
${{ secrets.SLACK_WEBHOOK_WALLET_PR }}
unit-tests-wasm:
needs: lint
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install protoc
run: sudo apt-get install -y protobuf-compiler
- name: Install wsrun
run: npm install -g wsrun
- name: Install wasm-pack
uses: jetli/[email protected]
with:
version: "v0.10.3"
- name: Run unit tests
id: run-unit-tests
run: yarn test-wasm:ci
- name: Report success
if: steps.run-unit-tests.outcome == 'success'
run: |
curl --header "Content-Type: application/json" \
--request POST \
--data '{"message":"Unit tests succeeded ✅\n \n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\n \nReview\nhttps://pull-request-${{ github.event.number }}--wallet-development-heliax-dev.netlify.app\n \nthe PR\nhttps://github.com/anoma/namada-interface/pull/${{ github.event.number }}"}' \
${{ secrets.SLACK_WEBHOOK_WALLET_PR }}
- name: Report failure
if: steps.run-unit-tests.outcome != 'success'
run: |
curl --header "Content-Type: application/json" \
--request POST \
--data '{"message":"Unit tests failed ⛔️ \n \n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\n \nReview\nhttps://pull-request-${{ github.event.number }}--wallet-development-heliax-dev.netlify.app\n \nthe PR\nhttps://github.com/anoma/namada-interface/pull/${{ github.event.number }}"}' \
${{ secrets.SLACK_WEBHOOK_WALLET_PR }}
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install protoc
run: sudo apt-get install -y protobuf-compiler
- name: Install dependencies
working-directory: ./apps/namada-interface
run: yarn
- name: Install wasm-pack
uses: jetli/[email protected]
with:
version: "v0.10.3"
- name: Rustup add target
run: rustup target add wasm32-unknown-unknown
- name: Install wasm-bindgen-cli
run: cargo install [email protected]
- name: build the site
working-directory: ./apps/namada-interface
run: yarn build
env:
REACT_APP_NAMADA_ALIAS: "Namada Devnet"
REACT_APP_NAMADA_CHAIN_ID: "internal-devnet-6be.86067e06a5"
REACT_APP_NAMADA_URL: "https://proxy.heliax.click/internal-devnet-6be.86067e06a5"
- name: Deploy to Netlify
uses: nwtgck/[email protected]
with:
publish-dir: "./apps/namada-interface/build"
production-branch: main
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: "deploy ${{ github.event.number }} at creating a PR"
alias: pull-request-${{ github.event.number }}
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_ACCESS_TOKEN_WALLET_PREVIEW }}
NETLIFY_SITE_ID: 1f548c68-c620-4522-97e0-0d85c08366fb
# namada.me
# NETLIFY_SITE_ID: 2380782e-9b20-477a-bc27-b4e9d05e16f3
- name: Slack Notification
run: |
curl --header "Content-Type: application/json" \
--request POST \
--data '{"message":"New deployment for a PR\nhttps://pull-request-${{ github.event.number }}--wallet-development-heliax-dev.netlify.app\n \nthe PR\nhttps://github.com/anoma/namada-interface/pull/${{ github.event.number }}"}' \
${{ secrets.SLACK_WEBHOOK_WALLET_PR }}
E2E-tests:
needs: build
timeout-minutes: 60
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./apps/namada-interface
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "18.x"
- name: Install wasm-pack
uses: jetli/[email protected]
with:
version: "v0.10.3"
- name: Install dependencies
run: yarn
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
id: run-playwright-tests
run: PLAYWRIGHT_BASE_URL=https://pull-request-${{ github.event.number }}--wallet-development-heliax-dev.netlify.app NETLIFY_SITE_PROTECTION_PASSWORD=${{ secrets.NETLIFY_SITE_PROTECTION_PASSWORD }} yarn playwright test
- name: report success
if: steps.run-playwright-tests.outcome == 'success'
run: |
curl --header "Content-Type: application/json" \
--request POST \
--data '{"message":"E2E tests succeeded ✅\n \n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\n \nReview\nhttps://pull-request-${{ github.event.number }}--wallet-development-heliax-dev.netlify.app\n \nthe PR\nhttps://github.com/anoma/namada-interface/pull/${{ github.event.number }}"}' \
${{ secrets.SLACK_WEBHOOK_WALLET_PR }}
- name: report failure
if: failure() && steps.run-playwright-tests.outcome != 'success'
run: |
curl --header "Content-Type: application/json" \
--request POST \
--data '{"message":"E2E tests failed ⛔️ \n \n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\n \nReview\nhttps://pull-request-${{ github.event.number }}--wallet-development-heliax-dev.netlify.app\n \nthe PR\nhttps://github.com/anoma/namada-interface/pull/${{ github.event.number }}"}' \
${{ secrets.SLACK_WEBHOOK_WALLET_PR }}
- uses: actions/upload-artifact@v2
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30