Skip to content

CSM-widget Tests. Env [testnet] #7

CSM-widget Tests. Env [testnet]

CSM-widget Tests. Env [testnet] #7

Workflow file for this run

name: Test CSM-widget
run-name: CSM-widget Tests. Env [${{ github.event.inputs.stand_type || 'testnet' }}]
on:
schedule:
- cron: "0 6 * * *" # Every day at 6 AM UTC
workflow_dispatch:
inputs:
stand_type:
description: "Stand type"
required: true
type: choice
default: testnet
options:
- prod
- staging
- testnet
- preview
tags:
description: "Tags for running test suite"
required: false
type: choice
default: "-"
options:
- "-"
- smoke
- performTX
preview_stand_url:
description: 'Preview stand url (only if "Stand type" is "preview")'
required: false
type: string
preview_stand_env:
description: 'Preview stand env (only if "Stand type" is "preview")'
required: false
type: choice
default: testnet
options:
- testnet
- infra
workflow_call:
inputs:
preview_stand_url:
required: true
type: string
description: Stand url
stand_type:
description: "Stand type"
required: true
type: string
tags:
required: false
type: string
default: "-"
description: "Test tags"
qase_plan_id:
required: false
type: number
description: "Qase Plan ID"
jobs:
test:
runs-on: ubuntu-24.04
env:
# Required envs
RPC_URL: ${{ secrets.RPC_URL }}
WALLET_SECRET_PHRASE: ${{ secrets.WALLET_SECRET_PHRASE }}
WALLET_PASSWORD: ${{ secrets.WALLET_PASSWORD }}
EMPTY_SECRET_PHRASE: ${{ secrets.EMPTY_SECRET_PHRASE }}
EMPTY_NODE_SECRET_PHRASE: ${{ secrets.EMPTY_NODE_SECRET_PHRASE }}
STAND_TYPE: ${{ inputs.stand_type || github.event.inputs.STAND_TYPE || 'testnet' }}
# Common envs
QASE_API_TOKEN: ${{ secrets.QASE_API_TOKEN }}
QASE_PROJECT_ID: "CSM"
QASE_PLAN_ID: "${{ inputs.qase_plan_id || (github.event_name == 'schedule' && 7) || '' }}"
GH_ACTION_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
GH_BRANCH_REF_NAME: ${{ github.ref_name }}
GH_EVENT_NAME: ${{ github.event_name }}
NODE_OPTIONS: --max-old-space-size=4096
TEST_TAGS: ${{ inputs.tags || github.event.inputs.tags || '!forked'}}
TEST_BRANCH: ${{ github.event.inputs.branch }}
REPORT_ENABLED: "${{ github.event_name == 'schedule' && 'true' || 'false' }}"
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL}}
DISCORD_DUTY_TAG: "&1372906915667116032"
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL}}
SLACK_DUTY_TAG: "S09H269H2TT"
# Optional envs
REFUSE_CF_BLOCK_NAME: ${{ secrets.REFUSE_CF_BLOCK_NAME }}
REFUSE_CF_BLOCK_VALUE: ${{ secrets.REFUSE_CF_BLOCK_VALUE }}
PUSHGATEWAY_URL: ${{ secrets.PUSHGATEWAY_URL }}
PUSHGATEWAY_USERNAME: ${{ secrets.PUSHGATEWAY_USERNAME }}
PUSHGATEWAY_PASSWORD: ${{ secrets.PUSHGATEWAY_PASSWORD }}
GRAFANA_URL: ${{ secrets.GRAFANA_URL }}
GRAFANA_API_KEY: ${{ secrets.GRAFANA_API_KEY }}
steps:
- uses: actions/checkout@v5
with:
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: "yarn"
- name: Restore yarn cache
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
run: yarn install --immutable
- name: Install Playwright Browsers
run: yarn playwright install chromium --with-deps
- name: Download keys generator binary
run: bash ./tests/scripts/set_up_keys_generator.sh
- name: Set up preview-stand credentials
if: ${{ inputs.stand_type == 'preview' || github.event.inputs.stand_type == 'preview' }}
run: |
if [ -n "${{ inputs.preview_stand_url || github.event.inputs.preview_stand_url }}" ]; then
echo "Setting login and password for preview stand"
echo "PREVIEW_STAND_LOGIN=${{ secrets.PREVIEW_STAND_LOGIN }}" >> $GITHUB_ENV
echo "PREVIEW_STAND_PASSWORD=${{ secrets.PREVIEW_STAND_PASSWORD }}" >> $GITHUB_ENV
echo "PREVIEW_STAND_URL=${{ inputs.preview_stand_url || github.event.inputs.preview_stand_url }}" >> $GITHUB_ENV
echo "PREVIEW_STAND_ENV=${{ github.event.inputs.preview_stand_env }}" >> $GITHUB_ENV
else
echo "PREVIEW_STAND_URL not provided for preview environment"
exit 1
fi
- name: Run tests based on suite input
run: |
echo -e "\033[34m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\033[0m"
echo -e "🚀 Running on Stand Type: \033[1;34m$STAND_TYPE\033[0m"
echo -e "🧪 Test Tags: \033[1;34m$TEST_TAGS\033[0m"
echo -e "🌱 Branch: \033[1;34m${GITHUB_HEAD_REF:-$GITHUB_REF_NAME}\033[0m"
echo -e "🔗 Test Plan: \033[1;34m${QASE_PLAN_ID}\033[0m"
echo -e "\033[34m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\033[0m"
xvfb-run --auto-servernum -- yarn test:e2e
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 1