vega-frontend-monorepo/.github/workflows/cypress-token-e2e.yml

95 lines
2.8 KiB
YAML
Raw Normal View History

name: Cypress - token
on:
workflow_call:
inputs:
trigger:
required: true
type: string
default: 'false'
skip-cache:
required: false
type: string
tags:
required: false
type: string
jobs:
token-e2e:
if: ${{ inputs.trigger == 'true' }}
runs-on: self-hosted
timeout-minutes: 60
steps:
- name: Vega version
run: vega version
- name: Vegacapsule version
run: vegacapsule version
# Checkout front ends
- name: Checkout frontend mono repo
uses: actions/checkout@v3
with:
fetch-depth: 0
path: './frontend-monorepo'
# Restore node_modules from cache if possible
- name: Restore node_modules from cache
uses: actions/cache@v3
with:
path: |
frontend-monorepo/node_modules
/home/runner/.cache/Cypress
key: node_modules_cypress-${{ hashFiles('frontend-monorepo/yarn.lock', 'frontend-monorepo/package.json') }}
# Install frontend dependencies
- name: Install root dependencies
run: yarn install --frozen-lockfile
working-directory: frontend-monorepo
######
## Setup a Vega wallet for our user
######
feat(#2255): capsule tests for trading (#2498) * feat: improve proposal types, add faucet for trading asset * chore: yarn lock update * fix: capsule tests to avoid jsx import * chore: throw error so that ethereum setup failure is caught * chore: org files and add logging * chore: revert current trading-e2e .env file * chore: add .env.capsule for trading tests on capsule * chore: remove unused nx command * chore: remove try catchs and allow errors to be caught by cypress * chore: add slow tag for capsule test * feat: move create market setup to libs/cypress * chore: clearly separate vars meant for capsule with vars meant for non-capsule * feat: remove hardcoded urls and use config obj * chore: fix missing comma in genesis.tmpl * chore: added limit order edit price test * chore: remove encoding of transaction, update proposal tx trigger ratio to string * chore: fix date and add date verification for update order * chore: formatting fix * chore: adjust trading app tests and workflows to be run in capsule in ci (#2574) * chore: adjust trading app tests and workflows to be run in capsule in ci * chore: fix token tests * chore: increase timeout as it fails in ci * chore: move market check to before function * chore: add capsule logs to trading * chore: increase proposal close time, also break up script for better debugging * chore: bump up ethereum account setup timeout * chore: suppress fetch logs to help with debugging * chore: revert cy wraps now with suppressed logging * chore: decrease tick amount * chore: promise with timeout for better debugging * chore: bump individual timeouts * chore: bump timeout for tx wait promises * chore: minor fix * fix: leave Promise<any> * fix: leave Promise<any> * chore: fix home fail Co-authored-by: Joe <joe@vega.xyz> Co-authored-by: Dariusz Majcherczyk <dariusz.majcherczyk@gmail.com> Co-authored-by: Radosław Szpiech <szpiechrados@gmail.com> Co-authored-by: Madalina Raicu <madalina@raygroup.uk>
2023-01-17 15:33:43 +00:00
- name: Run Vegacapsule network
uses: ./frontend-monorepo/.github/actions/run-vegacapsule
- name: Set up Vegawallet for capsule
id: setup-vega
uses: ./frontend-monorepo/.github/actions/setup-vegawallet-docker
######
## Run some tests
######
# To make sure that all Cypress binaries are installed properly
- name: Install cypress bins
run: yarn cypress install
working-directory: frontend-monorepo
- name: Run Cypress tests
run: npx nx run token-e2e:e2e ${{ inputs.skip-cache }} --record --key ${{ secrets.CYPRESS_RECORD_KEY }} --browser chrome ${{ inputs.tags }}
working-directory: frontend-monorepo
env:
CYPRESS_SLACK_WEBHOOK: ${{ secrets.CYPRESS_SLACK_WEBHOOK }}
CYPRESS_ETH_WALLET_MNEMONIC: ${{ secrets.CYPRESS_ETH_WALLET_MNEMONIC }}
CYPRESS_VEGA_WALLET_API_TOKEN: ${{ steps.setup-vega.outputs.token }}
######
## Upload logs
######
# Artifact path is not valid: /ganache-1/capsule-logscolletor.stderr-2022-12-22T10:20:30Z.log. Contains the following character: Colon :
- name: Rename files to allow archive
if: ${{ always() }}
run: |
while read -r file; do
mv "${file}" "$(echo ${file} | sed 's|:|-|g')"
done< <(find /home/runner/.vegacapsule/testnet/logs -type f)
- uses: actions/upload-artifact@v2
if: ${{ always() }}
with:
name: logs-token
2022-12-22 10:18:03 +00:00
path: /home/runner/.vegacapsule/testnet/logs