FE Microapps XCM tests #418
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: FE Microapps XCM tests | |
on: | |
workflow_dispatch: | |
inputs: | |
feBranch: | |
description: "Name of the FE target branch" | |
type: string | |
required: false | |
default: "main" | |
schedule: | |
- cron: "5 9 * * *" | |
jobs: | |
e2e-tm: | |
strategy: | |
fail-fast: false | |
matrix: | |
command: | |
[ | |
"microappsTransferKSM", | |
"microappsTransferBNC", | |
"microappsTransferTUR", | |
] | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
env: | |
API_URL: ws://127.0.0.1:9946 | |
SELENIUM_REMOTE_URL: http://localhost:4444/wd/hub | |
UI_URL: http://localhost:5500 | |
MANGATA_ASSETS_URL: https://storage.googleapis.com/mangata-assets | |
MANGATA_API_URL: ws://127.0.0.1:9946 | |
MANGATA_EXPLORER_URL: https://mangatax.subscan.io | |
MANGATA_PARACHAIN_ID: 2110 | |
MANGATA_TOKEN_ID: 0 | |
MANGATA_ANNUAL_MGX_POOL_REWARDS: "300000000000000000000000000" | |
MANGATA_MAX_DELEGATION_COUNT: 30 | |
MNEMONIC_POLK: "parrot reveal arena shrimp announce ten draw pretty forget caught advice jacket" | |
MNEMONIC_POLK_ECDSA: "catch alarm travel gravity crash pudding clip bike process wine virtual stamp" | |
MNEMONIC_POLK_ED25519: "nice say prison sword favorite sustain exit guitar own hen clip borrow" | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: yarn | |
cache-dependency-path: "**/yarn.lock" | |
#### Selenoid | |
- name: Start Selenoid Server | |
uses: Xotabu4/selenoid-github-action@v2 | |
with: | |
selenoid-start-arguments: | | |
--args "-timeout 300s" --browsers 'chrome:114.0' | |
#### App | |
- name: Checkout FE app | |
uses: actions/checkout@v3 | |
with: | |
repository: mangata-finance/microapps | |
token: ${{ secrets.PRIVATE_FE_REPO_ACCESS_TOKEN }} | |
ref: "${{ github.event.inputs.feBranch || inputs.feBranch }}" | |
path: microapps | |
- name: Install app dependencies | |
working-directory: microapps | |
run: yarn | |
- name: Create env file and env variables | |
working-directory: microapps | |
run: | | |
ifconfig | |
IP_ADDRESS=$(ifconfig eth0 | awk '/inet / {print $2}') | |
echo "LOCAL_ADDRESS=$IP_ADDRESS" >> $GITHUB_ENV | |
echo "STASH_URL=https://mangata-stash-prod-dot-direct-pixel-353917.oa.r.appspot.com" >> $GITHUB_ENV | |
echo MANGATA_ASSETS_URL="https://storage.googleapis.com/mangata-assets" >> .env | |
echo MANGATA_STASH_URL="http://$IP_ADDRESS:3456" >> .env | |
echo MANGATA_EXPLORER_URL="https://mangatax.subscan.io" >> .env | |
echo MANGATA_CHAIN_ENV="kusama" >> .env | |
echo MANGATA_API_URL=ws://$IP_ADDRESS:9946 >> .env | |
echo "MANGATA_API_URL=ws://$IP_ADDRESS:9946" >> $GITHUB_ENV | |
echo "API_URL=ws://$IP_ADDRESS:9946" >> $GITHUB_ENV | |
echo MANGATA_PARACHAIN_ID="2110" >> .env | |
echo MANGATA_ANNUAL_MGX_POOL_REWARDS="300000000000000000000000000" >> .env | |
echo MANGATA_MAX_DELEGATION_COUNT="30" >> .env | |
echo MANGATA_DEV_TOOLS=false >> .env | |
cat .env | |
- name: Install http-server | |
run: yarn global add http-server | |
- name: Build app | |
working-directory: microapps | |
run: yarn nx run dex:build:production | |
env: | |
NODE_OPTIONS: "--max_old_space_size=6144" | |
- name: Start app | |
working-directory: microapps | |
run: | | |
ifconfig | |
IP_ADDRESS=$(ifconfig eth0 | awk '/inet / {print $2}') | |
echo "UI_URL=http://$IP_ADDRESS:5500" >> $GITHUB_ENV | |
cd dist/packages/dex | |
http-server -p 5500 & | |
sleep 5s | |
- name: Install e2e tests dependencies | |
run: | | |
export SKIP_HUSKY=true | |
yarn | |
- name: is selenoid started? | |
run: | | |
curl http://localhost:4444/status | |
curl -I "$UI_URL" | |
- name: Run tests | |
run: | | |
echo ${{ env.UI_URL }} | |
yarn test-xcm-ui --group=${{ matrix.command }} | |
- name: Test Report | |
uses: dorny/[email protected] | |
if: always() | |
with: | |
name: E2E report ${{ matrix.command }} # Name of the check run which will be created | |
path: reports/*.xml # Path to test results | |
reporter: jest-junit # Format of test results | |
- name: Copy video files to reports folder | |
if: always() | |
run: | | |
# sleep is used to close buffers of videos | |
sleep 10s | |
cp ~/.aerokube/selenoid/* -r reports/artifacts/ | |
- name: Create reports zip | |
uses: vimtor/action-zip@v1 | |
if: always() | |
with: | |
files: reports/ | |
dest: reports.zip | |
- name: Archive report files | |
uses: actions/[email protected] | |
if: always() | |
with: | |
name: ReportData ${{ matrix.command }} | |
path: reports.zip | |
- name: Archive report files | |
uses: actions/[email protected] | |
if: always() | |
with: | |
name: TestReport ${{ matrix.command }} | |
path: reports/html-report/report.html |