Skip to content

feat: add response check for Paraswap API #412

feat: add response check for Paraswap API

feat: add response check for Paraswap API #412

Workflow file for this run

name: E2E Testing
on:
push:
branches:
- main
pull_request:
branches:
- main
types: [opened, reopened, 'synchronize', 'ready_for_review']
jobs:
build:
runs-on: ubuntu-latest-16-cores-core-extension
if: ${{ !github.event.pull_request.draft }}
environment: alpha
steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Checkout extension
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
- name: Create .npmrc
run: echo '//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}' >> .npmrc
- name: Create env file
run: |
touch .env.production
echo RELEASE=alpha >> .env.production
echo POSTHOG_KEY=${{ secrets.POSTHOG_KEY }} >> .env.production
echo POSTHOG_URL=${{ secrets.POSTHOG_URL }} >> .env.production
echo ANALYTICS_ENCRYPTION_KEY=${{ secrets.ANALYTICS_ENCRYPTION_KEY }} >> .env.production
echo ANALYTICS_ENCRYPTION_KEY_ID=${{ secrets.ANALYTICS_ENCRYPTION_KEY_ID }} >> .env.production
echo COVALENT_API_KEY=${{ secrets.COVALENT_API_KEY }} >> .env.production
echo GLACIER_URL=${{ secrets.GLACIER_URL }} >> .env.production
echo PROXY_URL=${{ secrets.PROXY_URL }} >> .env.production
echo CORE_EXTENSION_LANDING_URL=${{ secrets.CORE_EXTENSION_LANDING_URL }} >> .env.production
echo SENTRY_DSN=${{ secrets.SENTRY_DSN }} >> .env.production
echo CORE_WEB_BASE_URL=${{ secrets.CORE_WEB_BASE_URL }} >> .env.production
echo GLACIER_API_KEY=${{ secrets.GLACIER_API_KEY }} >> .env.production
echo WALLET_CONNECT_PROJECT_ID=${{ secrets.WALLET_CONNECT_PROJECT_ID }} >> .env.production
echo SEEDLESS_URL=${{ secrets.SEEDLESS_URL }} >> .env.production
echo SEEDLESS_ORG_ID=${{ secrets.SEEDLESS_ORG_ID }} >> .env.production
echo GOOGLE_OAUTH_CLIENT_ID=${{ secrets.GOOGLE_OAUTH_CLIENT_ID }} >> .env.production
echo APPLE_OAUTH_CLIENT_ID=${{ secrets.APPLE_OAUTH_CLIENT_ID }} >> .env.production
echo APPLE_OAUTH_REDIRECT_URL=${{ secrets.APPLE_OAUTH_REDIRECT_URL }} >> .env.production
echo CUBESIGNER_ENV=${{ secrets.CUBESIGNER_ENV }} >> .env.production
echo SEEDLESS_FIDO_IDENTITY_URL=${{ secrets.SEEDLESS_FIDO_IDENTITY_URL }} >> .env.production
echo NEWSLETTER_BASE_URL=${{ secrets.NEWSLETTER_BASE_URL }} >> .env.production
echo NEWSLETTER_PORTAL_ID=${{ secrets.NEWSLETTER_PORTAL_ID }} >> .env.production
echo NEWSLETTER_FORM_ID=${{ secrets.NEWSLETTER_FORM_ID }} >> .env.production
- name: Install dependencies
run: yarn setup
- name: Build library
run: yarn build:alpha
- name: Remove onboarding video
run: |
rm -fv ./dist/images/core-ext-hero-hq.webm
- name: Add extension key to manifest file
run: |
echo $(cat ./dist/manifest.json | jq '.key = "${{ secrets.EXTENSION_PUBLIC_KEY }}"') > ./dist/manifest.json
- name: Generate a zip
run: yarn zip
- name: Output extension file version before renaming
run: ls builds/*.zip
- name: Rename extension file
run: |
mv builds/*.zip builds/extension.zip
mv builds/extension.zip ${GITHUB_WORKSPACE}
- name: Upload builded zip file
uses: actions/upload-artifact@v4
with:
name: extension
path: extension.zip
e2e:
runs-on: ubuntu-latest-16-cores-core-extension
needs: build
name: Run E2E Smoke Tests
environment: e2e
env:
RUNNER: CI
LOG_LEVEL: info
POST_TO_TESTRAIL: true
TESTRAIL_API_KEY: ${{secrets.TESTRAIL_API_KEY}}
RECOVERY_PHRASE: ${{secrets.RECOVERY_PHRASE}}
METAMASK_RECOVERY_PHRASE: ${{secrets.METAMASK_RECOVERY_PHRASE}}
APITOKEN_ETHERSCAN: ${{secrets.APITOKEN_ETHERSCAN}}
APITOKEN_CRYPTOAPIS: ${{secrets.APITOKEN_CRYPTOAPIS}}
APITOKEN_SNOWTRACE: ${{secrets.APITOKEN_SNOWTRACE}}
steps:
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Checkout automation repo
uses: actions/checkout@v4
with:
repository: 'ava-labs/avalanche-test-automation'
path: './'
ssh-key: ${{ secrets.SSH_DEPLOY_KEY }}
- name: Install automation repo dependencies
run: yarn install
- name: Download builded zip file
uses: actions/download-artifact@v4
with:
name: extension
- name: Running browser extension smoke tests on testnet/mainnet against generated zip
run: yarn ext:testnet/mainnet-smoke
- if: always()
name: Set Testrail Run ID ENV
run: |
echo $(head -n 1 testrail_run_id.txt)
echo "TESTRAIL_RUN_ID=$(head -n 1 testrail_run_id.txt)" >> $GITHUB_ENV
- name: Success slack notification
if: success()
uses: slackapi/[email protected]
with:
payload: |
{
"GH_RUN_LINK": "https://github.com/ava-labs/core-extension/actions/runs/${{ github.run_id }}",
"GH_RUN_STATUS": "PASSED",
"STATUS_EMOJI": ":white_check_mark:",
"TEST_RUN_TYPE": "Browser extension smoke tests are running against branch= ${{ github.head_ref }}",
"TR_RUN_LINK": "https://avalabs.testrail.io/index.php?/runs/view/${{ env.TESTRAIL_RUN_ID }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
- name: Failure slack notification
if: failure()
uses: slackapi/[email protected]
with:
payload: |
{
"GH_RUN_LINK": "https://github.com/ava-labs/core-extension/actions/runs/${{ github.run_id }}",
"GH_RUN_STATUS": "FAILED",
"STATUS_EMOJI": ":alert:",
"TEST_RUN_TYPE": "Browser extension smoke tests are running against branch= ${{ github.head_ref }}",
"TR_RUN_LINK": "https://avalabs.testrail.io/index.php?/runs/view/${{ env.TESTRAIL_RUN_ID }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}