bug/353 - Ledger error-handling improvements #1347
Workflow file for this run
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: 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: Restore yarn cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
./node_modules | |
./apps/namada-interface/node_modules | |
./apps/extension/node_modules | |
./packages/chains/node_modules | |
./packages/components/node_modules | |
./packages/crypto/node_modules | |
./packages/hooks/node_modules | |
./packages/integrations/node_modules | |
./packages/ledger-namada/node_modules | |
./packages/rpc/node_modules | |
./packages/shared/node_modules | |
./packages/storage/node_modules | |
./packages/types/node_modules | |
./packages/utils/node_modules | |
key: ${{ runner.os }}-yarn-cache-${{ hashFiles('**/yarn.lock') }} | |
- name: Install dependencies | |
run: yarn | |
- name: Run ESLint | |
run: yarn lint:ci | |
unit-tests-js: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Restore yarn cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
./node_modules | |
./apps/namada-interface/node_modules | |
./apps/extension/node_modules | |
./packages/chains/node_modules | |
./packages/components/node_modules | |
./packages/crypto/node_modules | |
./packages/hooks/node_modules | |
./packages/integrations/node_modules | |
./packages/ledger-namada/node_modules | |
./packages/rpc/node_modules | |
./packages/shared/node_modules | |
./packages/storage/node_modules | |
./packages/types/node_modules | |
./packages/utils/node_modules | |
key: ${{ runner.os }}-yarn-cache-${{ hashFiles('**/yarn.lock') }} | |
- name: Restore Rust unit-tests-js cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
./packages/shared/lib/target | |
./packages/crypto/lib/target | |
key: ${{ runner.os }}-rust-cache-unit-tests-js-${{ hashFiles('**/Cargo.lock') }} | |
- name: Install protoc | |
run: sudo apt-get install -y protobuf-compiler | |
- name: Install dependencies | |
run: yarn | |
- name: Install wasm-pack | |
uses: jetli/wasm-pack-action@v0.4.0 | |
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: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Restore yarn cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
./node_modules | |
./apps/namada-interface/node_modules | |
./apps/extension/node_modules | |
./packages/chains/node_modules | |
./packages/components/node_modules | |
./packages/crypto/node_modules | |
./packages/hooks/node_modules | |
./packages/integrations/node_modules | |
./packages/ledger-namada/node_modules | |
./packages/rpc/node_modules | |
./packages/shared/node_modules | |
./packages/storage/node_modules | |
./packages/types/node_modules | |
./packages/utils/node_modules | |
key: ${{ runner.os }}-yarn-cache-${{ hashFiles('**/yarn.lock') }} | |
- name: Restore Rust unit-tests-wasm cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
./packages/shared/lib/target | |
./packages/crypto/lib/target | |
key: ${{ runner.os }}-rust-cache-unit-tests-wasm-${{ hashFiles('**/Cargo.lock') }} | |
- 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/wasm-pack-action@v0.4.0 | |
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: Restore yarn cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
./node_modules | |
./apps/namada-interface/node_modules | |
./apps/extension/node_modules | |
./packages/chains/node_modules | |
./packages/components/node_modules | |
./packages/crypto/node_modules | |
./packages/hooks/node_modules | |
./packages/integrations/node_modules | |
./packages/ledger-namada/node_modules | |
./packages/rpc/node_modules | |
./packages/shared/node_modules | |
./packages/storage/node_modules | |
./packages/types/node_modules | |
./packages/utils/node_modules | |
key: ${{ runner.os }}-yarn-cache-${{ hashFiles('**/yarn.lock') }} | |
- name: Restore Rust build cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
./packages/shared/lib/target | |
./packages/crypto/lib/target | |
key: ${{ runner.os }}-rust-cache-build-${{ hashFiles('**/Cargo.lock') }} | |
- 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/wasm-pack-action@v0.4.0 | |
with: | |
version: "v0.10.3" | |
- name: Rustup add target | |
run: rustup target add wasm32-unknown-unknown | |
- 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/actions-netlify@v1.2.3 | |
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 | |
- name: Restore yarn cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
./node_modules | |
./apps/namada-interface/node_modules | |
./apps/extension/node_modules | |
./packages/chains/node_modules | |
./packages/components/node_modules | |
./packages/crypto/node_modules | |
./packages/hooks/node_modules | |
./packages/integrations/node_modules | |
./packages/ledger-namada/node_modules | |
./packages/rpc/node_modules | |
./packages/shared/node_modules | |
./packages/storage/node_modules | |
./packages/types/node_modules | |
./packages/utils/node_modules | |
key: ${{ runner.os }}-yarn-cache-${{ hashFiles('**/yarn.lock') }} | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: "18.x" | |
- name: Install wasm-pack | |
uses: jetli/wasm-pack-action@v0.3.0 | |
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 |