2022-09-29 13:13:09 +00:00
|
|
|
name: Cypress tests -- manual trigger
|
2022-07-18 08:38:11 +00:00
|
|
|
|
|
|
|
# This workflow runs the frontend tests against chosen branch
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
project:
|
|
|
|
description: 'Project'
|
|
|
|
required: true
|
|
|
|
type: choice
|
|
|
|
options:
|
2022-07-18 11:55:31 +00:00
|
|
|
- explorer-e2e
|
2022-08-23 14:02:08 +00:00
|
|
|
- console-lite-e2e
|
2022-07-18 11:55:31 +00:00
|
|
|
- stats-e2e
|
|
|
|
- token-e2e
|
|
|
|
- trading-e2e
|
2022-09-29 17:11:52 +00:00
|
|
|
smokeOnly:
|
2022-09-22 17:40:11 +00:00
|
|
|
description: 'Run only smoke tests?'
|
2022-07-18 08:38:11 +00:00
|
|
|
required: true
|
|
|
|
type: boolean
|
2022-09-22 17:40:11 +00:00
|
|
|
default: false
|
2022-09-29 16:27:08 +00:00
|
|
|
skip-nx-cache:
|
|
|
|
description: 'Add --skip-nx-cache to cypress test'
|
|
|
|
required: false
|
|
|
|
type: boolean
|
|
|
|
default: false
|
2022-07-18 08:38:11 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
manual:
|
2022-09-29 13:13:09 +00:00
|
|
|
name: Run Cypress tests -- manual trigger
|
2022-09-26 12:56:53 +00:00
|
|
|
runs-on: self-hosted
|
2022-07-18 08:38:11 +00:00
|
|
|
env:
|
|
|
|
GO111MODULE: 'on'
|
2022-09-29 13:13:09 +00:00
|
|
|
GOBIN: /home/runner/go/bin
|
2022-10-17 14:11:13 +00:00
|
|
|
VEGA_VERSION: 'v0.58.0'
|
2022-07-18 08:38:11 +00:00
|
|
|
steps:
|
2022-09-29 16:27:08 +00:00
|
|
|
#######
|
|
|
|
## Setup flags
|
|
|
|
#######
|
|
|
|
|
|
|
|
- name: Set smoke tag
|
2022-09-30 09:02:55 +00:00
|
|
|
if: ${{ github.event.inputs.smokeOnly == 'true' }}
|
2022-09-29 16:27:08 +00:00
|
|
|
run: echo TAGS="--env.grepTags @smoke" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- name: Set --skip-nx-cache flag
|
2022-09-30 09:02:55 +00:00
|
|
|
if: ${{ github.event.inputs.skip-nx-cache == 'true' }}
|
2022-09-29 16:27:08 +00:00
|
|
|
run: echo SKIP_NX_CACHE="--skip-nx-cache" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
# See if we capsule is needed for this project
|
|
|
|
- name: Set capsule flag
|
2022-10-20 12:55:12 +00:00
|
|
|
if: ${{ github.event.inputs.project == 'explorer-e2e' || github.event.inputs.project == 'token-e2e'}}
|
2022-09-29 16:27:08 +00:00
|
|
|
run: echo RUN_CAPSULE=true >> $GITHUB_ENV
|
|
|
|
|
2022-07-18 08:38:11 +00:00
|
|
|
#######
|
|
|
|
## Setup langs
|
|
|
|
#######
|
|
|
|
- name: Set up Go
|
|
|
|
uses: actions/setup-go@v3
|
|
|
|
id: go
|
|
|
|
with:
|
2022-08-24 16:30:07 +00:00
|
|
|
go-version: 1.19
|
2022-09-29 13:13:09 +00:00
|
|
|
|
2022-07-18 08:38:11 +00:00
|
|
|
- name: Set up Node 16
|
|
|
|
uses: actions/setup-node@v2
|
|
|
|
id: npm
|
|
|
|
with:
|
|
|
|
node-version: 16
|
|
|
|
|
2022-09-26 12:56:53 +00:00
|
|
|
#######
|
|
|
|
## Install Yarn
|
|
|
|
#######
|
|
|
|
- name: Setup yarn
|
|
|
|
run: npm install -g yarn
|
|
|
|
|
2022-07-18 08:38:11 +00:00
|
|
|
#######
|
2022-09-22 16:19:18 +00:00
|
|
|
## Checkout repos
|
2022-07-18 08:38:11 +00:00
|
|
|
#######
|
|
|
|
|
2022-09-06 14:03:49 +00:00
|
|
|
# Checkout front ends
|
|
|
|
- name: Checkout frontend mono repo
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
path: './frontend-monorepo'
|
|
|
|
|
2022-09-23 13:56:47 +00:00
|
|
|
# Restore node_modules from cache if possible
|
|
|
|
- name: Restore node_modules from cache
|
|
|
|
uses: actions/cache@v3
|
2022-09-22 16:19:18 +00:00
|
|
|
with:
|
2022-09-23 13:56:47 +00:00
|
|
|
path: |
|
|
|
|
frontend-monorepo/node_modules
|
|
|
|
/home/runner/.cache/Cypress
|
|
|
|
key: node_modules_cypress-${{ hashFiles('frontend-monorepo/yarn.lock') }}
|
2022-09-22 16:19:18 +00:00
|
|
|
|
|
|
|
# Install frontend dependencies
|
|
|
|
- name: Install root dependencies
|
2022-09-23 13:56:47 +00:00
|
|
|
run: yarn install --frozen-lockfile
|
2022-09-22 16:19:18 +00:00
|
|
|
working-directory: frontend-monorepo
|
|
|
|
|
2022-07-18 08:38:11 +00:00
|
|
|
#######
|
2022-09-29 13:13:09 +00:00
|
|
|
## Build and run Vegacapsule network
|
2022-07-18 08:38:11 +00:00
|
|
|
#######
|
|
|
|
|
2022-08-24 09:14:42 +00:00
|
|
|
- name: Install Vega binaries
|
2022-09-29 13:13:09 +00:00
|
|
|
uses: ./frontend-monorepo/.github/actions/install-vega-binaries
|
|
|
|
with:
|
|
|
|
all: ${{ env.RUN_CAPSULE }}
|
|
|
|
version: ${{ env.VEGA_VERSION }}
|
|
|
|
gobin: ${{ env.GOBIN }}
|
2022-07-18 08:38:11 +00:00
|
|
|
|
2022-09-29 13:13:09 +00:00
|
|
|
- name: Build and run Vegacapsule network
|
2022-09-22 16:19:18 +00:00
|
|
|
if: ${{ env.RUN_CAPSULE }}
|
2022-09-29 13:13:09 +00:00
|
|
|
uses: ./frontend-monorepo/.github/actions/run-vegacapsule
|
|
|
|
with:
|
|
|
|
github-token: ${{ secrets.VEGA_CI_BOT_GITHUB_TOKEN }}
|
2022-07-18 08:38:11 +00:00
|
|
|
|
|
|
|
######
|
|
|
|
## Setup a Vega wallet for our user
|
|
|
|
######
|
2022-09-29 13:13:09 +00:00
|
|
|
|
|
|
|
- name: Set up Vegawallet
|
|
|
|
uses: ./frontend-monorepo/.github/actions/setup-vegawallet
|
|
|
|
with:
|
|
|
|
recovery: ${{ secrets.TRADING_TEST_VEGA_WALLET_RECOVERY }}
|
|
|
|
passphrase: ${{ secrets.CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE }}
|
|
|
|
capsule: ${{ env.RUN_CAPSULE }}
|
2022-07-18 08:38:11 +00:00
|
|
|
|
|
|
|
######
|
|
|
|
## Run some tests
|
|
|
|
######
|
|
|
|
|
2022-09-26 12:56:53 +00:00
|
|
|
# To make sure that all Cypress binaries are installed properly
|
|
|
|
- name: Install cypress bins
|
|
|
|
run: yarn cypress install
|
|
|
|
working-directory: frontend-monorepo
|
|
|
|
|
2022-07-18 08:38:11 +00:00
|
|
|
- name: Run Cypress tests
|
2022-09-29 16:27:08 +00:00
|
|
|
run: yarn nx run ${{ github.event.inputs.project }}:e2e ${{ env.SKIP_NX_CACHE }} --record --key ${{ secrets.CYPRESS_RECORD_KEY }} --browser chrome ${{ env.TAGS }}
|
2022-09-07 08:05:02 +00:00
|
|
|
working-directory: frontend-monorepo
|
2022-07-18 08:38:11 +00:00
|
|
|
env:
|
|
|
|
CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE: ${{ secrets.CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE }}
|
|
|
|
CYPRESS_SLACK_WEBHOOK: ${{ secrets.CYPRESS_SLACK_WEBHOOK }}
|
2022-09-29 16:02:40 +00:00
|
|
|
CYPRESS_ETH_WALLET_MNEMONIC: ${{ secrets.CYPRESS_ETH_WALLET_MNEMONIC }}
|
2022-10-19 15:48:57 +00:00
|
|
|
CYPRESS_TEARDOWN_NETWORK_AFTER_FLOWS: false
|
2022-07-18 08:38:11 +00:00
|
|
|
|
|
|
|
######
|
|
|
|
## Upload logs
|
|
|
|
######
|
|
|
|
|
|
|
|
- name: Logs
|
2022-09-23 13:56:47 +00:00
|
|
|
if: ${{ env.RUN_CAPSULE }}
|
2022-07-18 08:38:11 +00:00
|
|
|
run: vegacapsule network logs > vega-capsule-logs.txt
|
|
|
|
|
|
|
|
- uses: actions/upload-artifact@v2
|
2022-09-23 13:56:47 +00:00
|
|
|
if: ${{ env.RUN_CAPSULE }}
|
2022-07-18 08:38:11 +00:00
|
|
|
with:
|
|
|
|
name: logs
|
|
|
|
path: ./vega-capsule-logs.txt
|