Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into fix/transfer-bin
Browse files Browse the repository at this point in the history
  • Loading branch information
KuznetsovNikita committed Nov 21, 2024
2 parents 2e4dfa6 + 99cdf18 commit 13b9c26
Show file tree
Hide file tree
Showing 16 changed files with 312 additions and 349 deletions.
55 changes: 12 additions & 43 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,49 +90,18 @@ jobs:
rm ${{ github.workspace }}/AuthKey.p8
web-build:
name: web-build
runs-on: macos-13
timeout-minutes: 10

steps:
- name: Checkout to git repository
uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: ${{ env.node-version }}

- name: Enable Corepack
run: |
corepack enable
- name: Run install
uses: borales/actions-yarn@v5
with:
cmd: install

- name: Run build
uses: borales/actions-yarn@v5
env:
VITE_APP_AMPLITUDE: ${{ secrets.REACT_APP_AMPLITUDE_EXTENSION }}
VITE_APP_MEASUREMENT_ID: ${{ secrets.REACT_APP_MEASUREMENT_ID }}
VITE_APP_APTABASE: ${{ secrets.VITE_APP_APTABASE }}
VITE_APP_APTABASE_HOST: https://anonymous-analytics.tonkeeper.com
VITE_APP_LOCALES: en,zh_TW,zh_CN,id,ru,it,es,uk,tr,bg,uz,bn
VITE_APP_TONCONSOLE_HOST: https://pro.tonconsole.com
VITE_APP_TG_BOT_ID: ${{ secrets.REACT_APP_TG_BOT_ID }}
VITE_APP_STONFI_REFERRAL_ADDRESS: ${{ secrets.REACT_APP_STONFI_REFERRAL_ADDRESS }}
with:
cmd: build:web

- name: Publish to Cloudflare Pages
id: deploy
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy apps/web/dist --project-name=tonkeeper-web --branch=main
uses: ./.github/workflows/web-build.yaml
with:
environment: 'main'
secrets: inherit

web-tests:
needs: web-build
uses: ./.github/workflows/web-tests.yaml
with:
base-url: 'https://wallet.tonkeeper.com'
transaction: true
secrets: inherit

extension-build:
name: extension-build
Expand Down
55 changes: 10 additions & 45 deletions .github/workflows/deploy-web.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,49 +12,14 @@ on:

jobs:
web-deploy:
name: web-deploy
runs-on: ubuntu-latest
timeout-minutes: 10
uses: ./.github/workflows/web-build.yaml
with:
environment: ${{ inputs.environment }}
secrets: inherit

steps:
- name: Checkout to git repository
uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20.11.1

- name: Enable Corepack
run: |
corepack enable
- name: Run install
uses: borales/actions-yarn@v5
with:
cmd: install

- name: Run build
uses: borales/actions-yarn@v5
env:
VITE_APP_AMPLITUDE: ${{ secrets.REACT_APP_AMPLITUDE_EXTENSION }}
VITE_APP_MEASUREMENT_ID: ${{ secrets.REACT_APP_MEASUREMENT_ID }}
VITE_APP_APTABASE: ${{ secrets.VITE_APP_APTABASE }}
VITE_APP_APTABASE_HOST: https://anonymous-analytics.tonkeeper.com
VITE_APP_LOCALES: en,zh_TW,zh_CN,id,ru,it,es,uk,tr,bg,uz,bn
VITE_APP_TONCONSOLE_HOST: https://pro.tonconsole.com
VITE_APP_TG_BOT_ID: ${{ secrets.REACT_APP_TG_BOT_ID }}
VITE_APP_STONFI_REFERRAL_ADDRESS: ${{ secrets.REACT_APP_STONFI_REFERRAL_ADDRESS }}
with:
cmd: build:web

- name: Publish to Cloudflare Pages
id: deploy
if: contains(github.ref, 'main') || inputs.environment == 'dev'
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command:
pages deploy apps/web/dist --project-name=tonkeeper-web --branch=${{
inputs.environment }}
web-tests:
needs: web-deploy
uses: ./.github/workflows/web-tests.yaml
with:
base-url: ${{ needs.web-deploy.outputs.deployment-url }}
secrets: inherit
54 changes: 12 additions & 42 deletions .github/workflows/playwright.yaml
Original file line number Diff line number Diff line change
@@ -1,45 +1,15 @@
name: Tonkeeper Playwright
name: Tonkeeper Web Playwright
on:
workflow_dispatch:
inputs:
base-url:
type: string
description: App Url
default: https://wallet.tonkeeper.com
jobs:
playwright-tests:
name: playwright-tests
timeout-minutes: 60
runs-on: ubuntu-latest

steps:
- name: Checkout to git repository
uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: lts/*

- name: Enable Corepack
run: |
corepack enable
- name: Run install
uses: borales/actions-yarn@v5
with:
cmd: install

- name: Install Playwright Browsers
working-directory: ./tests/playwright
run: npx playwright install --with-deps chromium

- name: Run Playwright tests
working-directory: ./tests/playwright
env:
BASE_APP_URL: https://wallet.tonkeeper.com
TON_MNEMONIC_24: ${{ secrets.TON_MNEMONIC_24 }}
TON_MNEMONIC_24_2: ${{ secrets.TON_MNEMONIC_24_2 }}
TON_MNEMONIC_24_3: ${{ secrets.TON_MNEMONIC_24_3 }}
TON_MNEMONIC_24_4: ${{ secrets.TON_MNEMONIC_24_4 }}
TON_MNEMONIC_24_5: ${{ secrets.TON_MNEMONIC_24_5 }}
TON_MNEMONIC_ANANAS: ${{ secrets.TON_MNEMONIC_ANANAS }}
TON_MNEMONIC_12: ${{ secrets.TON_MNEMONIC_12 }}
TON_MNEMONIC_12_2: ${{ secrets.TON_MNEMONIC_12_2 }}
FAKE_MNEMONIC: ${{ secrets.FAKE_MNEMONIC }}
run: npx playwright test --project='chromium'
web-tests:
uses: ./.github/workflows/web-tests.yaml
with:
base-url: ${{ inputs.base-url }}
transaction: true
secrets: inherit
118 changes: 9 additions & 109 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,68 +121,10 @@ jobs:
rm ${{ github.workspace }}/AuthKey.p8
web-build:
name: web-build
runs-on: ubuntu-latest
timeout-minutes: 10

outputs:
deployment-url: ${{ steps.deploy.outputs.deployment-url }}
steps:
- name: Checkout to git repository
uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: ${{ env.node-version }}

- name: Enable Corepack
run: |
corepack enable
- name: Run install
uses: borales/actions-yarn@v5
with:
cmd: install

- name: Run build
uses: borales/actions-yarn@v5
env:
VITE_APP_AMPLITUDE: ${{ secrets.REACT_APP_AMPLITUDE_EXTENSION }}
VITE_APP_MEASUREMENT_ID: ${{ secrets.REACT_APP_MEASUREMENT_ID }}
VITE_APP_APTABASE: ${{ secrets.VITE_APP_APTABASE }}
VITE_APP_APTABASE_HOST: https://anonymous-analytics.tonkeeper.com
VITE_APP_LOCALES: en,zh_TW,zh_CN,id,ru,it,es,uk,tr,bg,uz,bn
VITE_APP_TONCONSOLE_HOST: https://pro.tonconsole.com
VITE_APP_TG_BOT_ID: ${{ secrets.REACT_APP_TG_BOT_ID }}
VITE_APP_STONFI_REFERRAL_ADDRESS: ${{ secrets.REACT_APP_STONFI_REFERRAL_ADDRESS }}
with:
cmd: build:web

- name: Publish to Cloudflare Pages
id: deploy
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy apps/web/dist --project-name=tonkeeper-web

- name: Summary
run: |
echo '### Successful WEB deployment 🚀🚀🚀' >> $GITHUB_STEP_SUMMARY
echo 'Well done!' >> $GITHUB_STEP_SUMMARY
echo 'Link to test environment:' >> $GITHUB_STEP_SUMMARY
echo '${{ steps.deploy.outputs.deployment-url }}' >> $GITHUB_STEP_SUMMARY
- name: Comment PR
uses: thollander/actions-comment-pull-request@v3
with:
message: |
### Successful WEB deployment 🚀🚀🚀
Well done!
Link to test environment:
${{ steps.deploy.outputs.deployment-url }}
comment-tag: web_deploy
uses: ./.github/workflows/web-build.yaml
with:
environment: ${{ github.head_ref }}
secrets: inherit

twa-build:
name: twa-build
Expand Down Expand Up @@ -293,51 +235,9 @@ jobs:
path: |
${{ github.workspace }}/apps/extension/dist/firefox
playwright-tests:
name: playwright-tests
runs-on: ubuntu-latest
timeout-minutes: 20
web-tests:
needs: web-build

steps:
- name: Checkout to git repository
uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: lts/*

- name: Enable Corepack
run: |
corepack enable
- name: Run install
uses: borales/actions-yarn@v5
with:
cmd: install

- name: Install Playwright Browsers
working-directory: ./tests/playwright
run: npx playwright install --with-deps chromium

- name: Run Playwright tests
working-directory: ./tests/playwright
env:
BASE_APP_URL: ${{ needs.web-build.outputs.deployment-url }}
TON_MNEMONIC_24: ${{ secrets.TON_MNEMONIC_24 }}
TON_MNEMONIC_24_2: ${{ secrets.TON_MNEMONIC_24_2 }}
TON_MNEMONIC_24_3: ${{ secrets.TON_MNEMONIC_24_3 }}
TON_MNEMONIC_24_4: ${{ secrets.TON_MNEMONIC_24_4 }}
TON_MNEMONIC_24_5: ${{ secrets.TON_MNEMONIC_24_5 }}
TON_MNEMONIC_ANANAS: ${{ secrets.TON_MNEMONIC_ANANAS }}
TON_MNEMONIC_12: ${{ secrets.TON_MNEMONIC_12 }}
TON_MNEMONIC_12_2: ${{ secrets.TON_MNEMONIC_12_2 }}
FAKE_MNEMONIC: ${{ secrets.FAKE_MNEMONIC }}
run: npx playwright test --project='chromium'

- name: Comment Playwright report
uses: daun/playwright-report-summary@v3
if: always()
with:
report-file: ./tests/playwright/results.json
uses: ./.github/workflows/web-tests.yaml
with:
base-url: ${{ needs.web-build.outputs.deployment-url }}
secrets: inherit
Loading

0 comments on commit 13b9c26

Please sign in to comment.