chore(#1897): create separate e2e workflows to be run in parallel (#1969)

* test: modify existing workflows to make them run specific tests on separate runners

* chore: increase token-e2e job timeout
This commit is contained in:
Radosław Szpiech 2022-11-08 11:33:22 +01:00 committed by GitHub
parent c576037b58
commit 64b06ca801
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 172 additions and 349 deletions

View File

@ -14,18 +14,18 @@ runs:
if: ${{ inputs.all }} if: ${{ inputs.all }}
shell: bash shell: bash
run: | run: |
wget 'https://github.com/vegaprotocol/vega/releases/download/${{ env.VEGA_VERSION }}/vega-linux-amd64.zip' -q wget 'https://github.com/vegaprotocol/vega/releases/download/${{ inputs.version }}/vega-linux-amd64.zip' -q
unzip vega-linux-amd64.zip -d ${{ inputs.gobin }} unzip vega-linux-amd64.zip -d ${{ inputs.gobin }}
- name: Install date-node binaries - name: Install date-node binaries
if: ${{ inputs.all }} if: ${{ inputs.all }}
shell: bash shell: bash
run: | run: |
wget 'https://github.com/vegaprotocol/vega/releases/download/${{ env.VEGA_VERSION }}/data-node-linux-amd64.zip' -q wget 'https://github.com/vegaprotocol/vega/releases/download/${{ inputs.version }}/data-node-linux-amd64.zip' -q
unzip data-node-linux-amd64.zip -d ${{ inputs.gobin }} unzip data-node-linux-amd64.zip -d ${{ inputs.gobin }}
- name: Install Vega wallet binaries - name: Install Vega wallet binaries
shell: bash shell: bash
run: | run: |
wget 'https://github.com/vegaprotocol/vega/releases/download/${{ env.VEGA_VERSION }}/vegawallet-linux-amd64.zip' -q wget 'https://github.com/vegaprotocol/vega/releases/download/${{ inputs.version }}/vegawallet-linux-amd64.zip' -q
unzip vegawallet-linux-amd64.zip -d ${{ inputs.gobin }} unzip vegawallet-linux-amd64.zip -d ${{ inputs.gobin }}

View File

@ -10,150 +10,51 @@ on:
required: true required: true
type: choice type: choice
options: options:
- explorer-e2e
- console-lite-e2e - console-lite-e2e
- explorer-e2e
- liquidity-provision-dashboard-e2e
- stats-e2e - stats-e2e
- token-e2e - token-e2e
- trading-e2e - trading-e2e
smokeOnly: tags:
description: 'Run only smoke tests?' description: 'Test tags to run'
required: true required: true
type: boolean type: string
default: false default: '@smoke, @regression, @slow'
skip-nx-cache: skip-nx-cache:
description: 'Add --skip-nx-cache to cypress test' description: 'Add --skip-nx-cache to cypress test'
required: false required: false
type: boolean type: boolean
default: false default: false
env:
GOBIN: /home/runner/go/bin
VEGA_VERSION: 'v0.58.0'
jobs: jobs:
manual: manual:
name: Run Cypress tests -- manual trigger name: Run Cypress tests -- manual trigger
runs-on: self-hosted runs-on: ubuntu-latest
env:
GO111MODULE: 'on'
GOBIN: /home/runner/go/bin
VEGA_VERSION: 'v0.58.0'
steps: steps:
####### - name: Set tags
## Setup flags run: echo TAGS="--env.grepTags [ ${{ github.event.inputs.tags }} ]" >> $GITHUB_ENV
#######
- name: Set smoke tag
if: ${{ github.event.inputs.smokeOnly == 'true' }}
run: echo TAGS="--env.grepTags @smoke" >> $GITHUB_ENV
- name: Set --skip-nx-cache flag - name: Set --skip-nx-cache flag
if: ${{ github.event.inputs.skip-nx-cache == 'true' }} if: ${{ github.event.inputs.skip-nx-cache == 'true' }}
run: echo SKIP_NX_CACHE="--skip-nx-cache" >> $GITHUB_ENV run: echo SKIP_NX_CACHE="--skip-nx-cache" >> $GITHUB_ENV
# See if we capsule is needed for this project outputs:
- name: Set capsule flag vega-version: ${{env.VEGA_VERSION}}
if: ${{ github.event.inputs.project == 'explorer-e2e' || github.event.inputs.project == 'token-e2e'}} gobin: ${{env.GOBIN}}
run: echo RUN_CAPSULE=true >> $GITHUB_ENV skip-cache: ${{env.SKIP_NX_CACHE}}
tags: ${{env.TAGS}}
####### dispatch:
## Setup langs needs: manual
####### uses: ./.github/workflows/tests-dispatcher.yml
- name: Set up Go secrets: inherit
uses: actions/setup-go@v3 with:
id: go project: ${{ inputs.project }}
with: vega-version: ${{needs.manual.outputs.vega-version}}
go-version: 1.19 gobin: ${{needs.manual.outputs.gobin}}
skip-cache: ${{needs.manual.outputs.skip-cache}}
- name: Set up Node 16 tags: ${{needs.manual.outputs.tags}}
uses: actions/setup-node@v2
id: npm
with:
node-version: 16
#######
## Install Yarn
#######
- name: Setup yarn
run: npm install -g yarn
#######
## Checkout repos
#######
# Checkout front ends
- name: Checkout frontend mono repo
uses: actions/checkout@v2
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') }}
# Install frontend dependencies
- name: Install root dependencies
run: yarn install --frozen-lockfile
working-directory: frontend-monorepo
#######
## Build and run Vegacapsule network
#######
- name: Install Vega binaries
uses: ./frontend-monorepo/.github/actions/install-vega-binaries
with:
all: ${{ env.RUN_CAPSULE }}
version: ${{ env.VEGA_VERSION }}
gobin: ${{ env.GOBIN }}
- name: Build and run Vegacapsule network
if: ${{ env.RUN_CAPSULE }}
uses: ./frontend-monorepo/.github/actions/run-vegacapsule
with:
github-token: ${{ secrets.VEGA_CI_BOT_GITHUB_TOKEN }}
######
## Setup a Vega wallet for our user
######
- 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 }}
######
## 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: yarn nx run ${{ github.event.inputs.project }}:e2e ${{ env.SKIP_NX_CACHE }} --record --key ${{ secrets.CYPRESS_RECORD_KEY }} --browser chrome ${{ env.TAGS }}
working-directory: frontend-monorepo
env:
CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE: ${{ secrets.CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE }}
CYPRESS_SLACK_WEBHOOK: ${{ secrets.CYPRESS_SLACK_WEBHOOK }}
CYPRESS_ETH_WALLET_MNEMONIC: ${{ secrets.CYPRESS_ETH_WALLET_MNEMONIC }}
CYPRESS_TEARDOWN_NETWORK_AFTER_FLOWS: false
######
## Upload logs
######
- name: Logs
if: ${{ env.RUN_CAPSULE }}
run: vegacapsule network logs > vega-capsule-logs.txt
- uses: actions/upload-artifact@v2
if: ${{ env.RUN_CAPSULE }}
with:
name: logs
path: ./vega-capsule-logs.txt

View File

@ -9,115 +9,11 @@ on:
jobs: jobs:
nightly: nightly:
name: Run Cypress tests -- nightly uses: ./.github/workflows/tests-dispatcher.yml
runs-on: self-hosted secrets: inherit
timeout-minutes: 60 with:
env: project: '[console-lite-e2e, explorer-e2e, liquidity-provisioning-dashboard-e2e, stats-e2e, token-e2e, trading-e2e]'
GO111MODULE: 'on' vega-version: 'v0.58.0'
GOBIN: /home/runner/go/bin gobin: /home/runner/go/bin
VEGA_VERSION: 'v0.58.0' tags: '@smoke, @regression, @slow'
RUN_CAPSULE: true night-run: true
steps:
#######
## Setup langs
#######
- name: Set up Go
uses: actions/setup-go@v3
id: go
with:
go-version: 1.19
- name: Set up Node 16
uses: actions/setup-node@v2
id: npm
with:
node-version: 16
#######
## Install Yarn
#######
- name: Setup yarn
run: npm install -g yarn
#######
## Checkout repos
#######
# Checkout front ends
- name: Checkout frontend mono repo
uses: actions/checkout@v2
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') }}
# Install frontend dependencies
- name: Install root dependencies
run: yarn install --frozen-lockfile
working-directory: frontend-monorepo
#######
## Build and run Vegacapsule network
#######
- name: Install Vega binaries
uses: ./frontend-monorepo/.github/actions/install-vega-binaries
with:
all: ${{ env.RUN_CAPSULE }}
version: ${{ env.VEGA_VERSION }}
gobin: ${{ env.GOBIN }}
- name: Build and run Vegacapsule network
if: ${{ env.RUN_CAPSULE }}
uses: ./frontend-monorepo/.github/actions/run-vegacapsule
with:
github-token: ${{ secrets.VEGA_CI_BOT_GITHUB_TOKEN }}
######
## Setup a Vega wallet for our user
######
- 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 }}
######
## 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: yarn nx run-many --skip-nx-cache --target=e2e --all --record --key ${{ secrets.CYPRESS_RECORD_KEY }} --browser chrome --parallel=1
working-directory: frontend-monorepo
env:
CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE: ${{ secrets.CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE }}
CYPRESS_SLACK_WEBHOOK: ${{ secrets.CYPRESS_SLACK_WEBHOOK }}
CYPRESS_ETH_WALLET_MNEMONIC: ${{ secrets.CYPRESS_ETH_WALLET_MNEMONIC }}
CYPRESS_NIGHTLY_RUN: true
CYPRESS_TEARDOWN_NETWORK_AFTER_FLOWS: true
######
## Upload logs
######
- name: Logs
run: vegacapsule network logs > vega-capsule-logs.txt
- uses: actions/upload-artifact@v2
with:
name: logs
path: ./vega-capsule-logs.txt

View File

@ -1,4 +1,4 @@
name: Cypress tests name: Cypress tests - PR
on: on:
push: push:
@ -12,41 +12,14 @@ on:
- synchronize - synchronize
- ready_for_review - ready_for_review
env:
GOBIN: /home/runner/go/bin
VEGA_VERSION: 'v0.58.0'
jobs: jobs:
pr: pr:
name: Run Cypress tests - PR runs-on: ubuntu-latest
runs-on: self-hosted
timeout-minutes: 30
env:
GO111MODULE: 'on'
GOBIN: /home/runner/go/bin
VEGA_VERSION: 'v0.58.0'
steps: steps:
#######
## Setup langs
#######
- name: Set up Go
uses: actions/setup-go@v3
id: go
with:
go-version: 1.19
- name: Set up Node 16
uses: actions/setup-node@v2
id: npm
with:
node-version: 16
#######
## Install Yarn
#######
- name: Setup yarn
run: npm install -g yarn
#######
## Checkout repos
#######
# Checkout front ends # Checkout front ends
- name: Checkout frontend mono repo - name: Checkout frontend mono repo
uses: actions/checkout@v2 uses: actions/checkout@v2
@ -76,71 +49,22 @@ jobs:
main-branch-name: ${{ github.base_ref || github.ref_name }} main-branch-name: ${{ github.base_ref || github.ref_name }}
set-environment-variables-for-job: true set-environment-variables-for-job: true
# See if we capsule is needed for this project # See affected projects
- name: See affected apps - name: See affected apps
run: echo AFFECTED=$(yarn nx print-affected --base=${{ env.NX_BASE }} --head=${{ env.NX_HEAD }} --select=projects) >> $GITHUB_ENV run: echo AFFECTED=$(yarn nx print-affected --base=${{ env.NX_BASE }} --head=${{ env.NX_HEAD }} --select=projects) >> $GITHUB_ENV
working-directory: frontend-monorepo working-directory: frontend-monorepo
- name: See if capsule is necessary outputs:
if: ${{ contains(env.AFFECTED, 'token') || contains(env.AFFECTED, 'token-e2e') || contains(env.AFFECTED, 'explorer') || contains(env.AFFECTED, 'explorer-e2e') }} projects: ${{ env.AFFECTED }}
run: echo RUN_CAPSULE=true >> $GITHUB_ENV vega-version: ${{ env.VEGA_VERSION }}
gobin: ${{ env.GOBIN }}
####### dispatch:
## Build and run Vegacapsule network needs: pr
####### uses: ./.github/workflows/tests-dispatcher.yml
secrets: inherit
- name: Install Vega binaries with:
uses: ./frontend-monorepo/.github/actions/install-vega-binaries project: ${{ needs.manual.outputs.projects }}
with: vega-version: ${{needs.manual.outputs.vega-version}}
all: ${{ env.RUN_CAPSULE }} gobin: ${{needs.manual.outputs.gobin}}
version: ${{ env.VEGA_VERSION }} tags: "--env.grepTags='@smoke'"
gobin: ${{ env.GOBIN }}
- name: Build and run Vegacapsule network
if: ${{ env.RUN_CAPSULE }}
uses: ./frontend-monorepo/.github/actions/run-vegacapsule
with:
github-token: ${{ secrets.VEGA_CI_BOT_GITHUB_TOKEN }}
######
## Setup a Vega wallet for our user
######
- 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 }}
######
## 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 affected:e2e --record --key ${{ secrets.CYPRESS_RECORD_KEY }} --env.grepTags='@smoke' --browser chrome
working-directory: frontend-monorepo
env:
CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE: ${{ secrets.CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE }}
CYPRESS_SLACK_WEBHOOK: ${{ secrets.CYPRESS_SLACK_WEBHOOK }}
CYPRESS_ETH_WALLET_MNEMONIC: ${{ secrets.CYPRESS_ETH_WALLET_MNEMONIC }}
CYPRESS_TEARDOWN_NETWORK_AFTER_FLOWS: false
######
## Upload logs
######
- name: Logs
if: ${{ env.RUN_CAPSULE }}
run: vegacapsule network logs > vega-capsule-logs.txt
- uses: actions/upload-artifact@v2
if: ${{ env.RUN_CAPSULE }}
with:
name: logs
path: ./vega-capsule-logs.txt

View File

@ -10,6 +10,9 @@ on:
required: false required: false
type: string type: string
default: /home/runner/go/bin default: /home/runner/go/bin
skip-cache:
required: false
type: string
tags: tags:
required: false required: false
type: string type: string
@ -38,6 +41,11 @@ jobs:
/home/runner/.cache/Cypress /home/runner/.cache/Cypress
key: node_modules_cypress-${{ hashFiles('frontend-monorepo/yarn.lock') }} key: node_modules_cypress-${{ hashFiles('frontend-monorepo/yarn.lock') }}
# Install frontend dependencies
- name: Install root dependencies
run: yarn install --frozen-lockfile
working-directory: frontend-monorepo
####### #######
## Build and run Vegacapsule network ## Build and run Vegacapsule network
####### #######
@ -66,10 +74,9 @@ jobs:
working-directory: frontend-monorepo working-directory: frontend-monorepo
- name: Run Cypress tests - name: Run Cypress tests
run: npx nx run console-lite-e2e:e2e --record --key ${{ secrets.CYPRESS_RECORD_KEY }} --browser chrome ${{ inputs.tags }} run: npx nx run console-lite-e2e:e2e ${{ inputs.skip-cache }} --record --key ${{ secrets.CYPRESS_RECORD_KEY }} --browser chrome ${{ inputs.tags }}
working-directory: frontend-monorepo working-directory: frontend-monorepo
env: env:
CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE: ${{ secrets.CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE }} CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE: ${{ secrets.CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE }}
CYPRESS_SLACK_WEBHOOK: ${{ secrets.CYPRESS_SLACK_WEBHOOK }} CYPRESS_SLACK_WEBHOOK: ${{ secrets.CYPRESS_SLACK_WEBHOOK }}
CYPRESS_ETH_WALLET_MNEMONIC: ${{ secrets.CYPRESS_ETH_WALLET_MNEMONIC }} CYPRESS_ETH_WALLET_MNEMONIC: ${{ secrets.CYPRESS_ETH_WALLET_MNEMONIC }}
CYPRESS_TEARDOWN_NETWORK_AFTER_FLOWS: false

View File

@ -10,19 +10,25 @@ on:
required: false required: false
type: string type: string
default: /home/runner/go/bin default: /home/runner/go/bin
skip-cache:
required: false
type: string
tags: tags:
required: false required: false
type: string type: string
night-run:
required: false
type: boolean
default: false
jobs: jobs:
explorer-e2e: explorer-e2e:
name: Run Cypress tests - PR
runs-on: self-hosted runs-on: self-hosted
timeout-minutes: 30 timeout-minutes: 30
steps: steps:
# Add GOBIN to PATH # Add GOBIN to PATH
- name: Add GOBIN to PATH - name: Add GOBIN to PATH
run: echo ${{ input.gobin }} >> $GITHUB_PATH run: echo ${{ inputs.gobin }} >> $GITHUB_PATH
# Checkout front ends # Checkout front ends
- name: Checkout frontend mono repo - name: Checkout frontend mono repo
@ -82,13 +88,14 @@ jobs:
working-directory: frontend-monorepo working-directory: frontend-monorepo
- name: Run Cypress tests - name: Run Cypress tests
run: npx nx explorer-e2e:e2e --record --key ${{ secrets.CYPRESS_RECORD_KEY }} --browser chrome ${{ inputs.tags }} run: npx nx run explorer-e2e:e2e ${{ inputs.skip-cache }} --record --key ${{ secrets.CYPRESS_RECORD_KEY }} --browser chrome ${{ inputs.tags }}
working-directory: frontend-monorepo working-directory: frontend-monorepo
env: env:
CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE: ${{ secrets.CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE }} CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE: ${{ secrets.CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE }}
CYPRESS_SLACK_WEBHOOK: ${{ secrets.CYPRESS_SLACK_WEBHOOK }} CYPRESS_SLACK_WEBHOOK: ${{ secrets.CYPRESS_SLACK_WEBHOOK }}
CYPRESS_ETH_WALLET_MNEMONIC: ${{ secrets.CYPRESS_ETH_WALLET_MNEMONIC }} CYPRESS_ETH_WALLET_MNEMONIC: ${{ secrets.CYPRESS_ETH_WALLET_MNEMONIC }}
CYPRESS_TEARDOWN_NETWORK_AFTER_FLOWS: false CYPRESS_TEARDOWN_NETWORK_AFTER_FLOWS: false
CYPRESS_NIGHTLY_RUN: ${{ inputs.night-run }}
###### ######
## Upload logs ## Upload logs

View File

@ -1,6 +1,7 @@
name: Cypress - liquidity provision dashboard name: Cypress - liquidity provision dashboard
on: workflow_call on: workflow_call
jobs: jobs:
liquidity-provision-dashboard-e2e: liquidity-provision-dashboard-e2e:
timeout-minutes: 10 timeout-minutes: 10
@ -32,4 +33,3 @@ jobs:
working-directory: frontend-monorepo working-directory: frontend-monorepo
env: env:
CYPRESS_SLACK_WEBHOOK: ${{ secrets.CYPRESS_SLACK_WEBHOOK }} CYPRESS_SLACK_WEBHOOK: ${{ secrets.CYPRESS_SLACK_WEBHOOK }}
CYPRESS_TEARDOWN_NETWORK_AFTER_FLOWS: false

View File

@ -1,6 +1,7 @@
name: Cypress - stats name: Cypress - stats
on: workflow_call on: workflow_call
jobs: jobs:
stats-e2e: stats-e2e:
runs-on: self-hosted runs-on: self-hosted
@ -22,6 +23,11 @@ jobs:
/home/runner/.cache/Cypress /home/runner/.cache/Cypress
key: node_modules_cypress-${{ hashFiles('frontend-monorepo/yarn.lock') }} key: node_modules_cypress-${{ hashFiles('frontend-monorepo/yarn.lock') }}
# Install frontend dependencies
- name: Install root dependencies
run: yarn install --frozen-lockfile
working-directory: frontend-monorepo
# To make sure that all Cypress binaries are installed properly # To make sure that all Cypress binaries are installed properly
- name: Install cypress bins - name: Install cypress bins
run: yarn cypress install run: yarn cypress install
@ -32,4 +38,3 @@ jobs:
working-directory: frontend-monorepo working-directory: frontend-monorepo
env: env:
CYPRESS_SLACK_WEBHOOK: ${{ secrets.CYPRESS_SLACK_WEBHOOK }} CYPRESS_SLACK_WEBHOOK: ${{ secrets.CYPRESS_SLACK_WEBHOOK }}
CYPRESS_TEARDOWN_NETWORK_AFTER_FLOWS: false

View File

@ -10,15 +10,17 @@ on:
required: false required: false
type: string type: string
default: /home/runner/go/bin default: /home/runner/go/bin
skip-cache:
required: false
type: string
tags: tags:
required: false required: false
type: string type: string
jobs: jobs:
token-e2e: token-e2e:
name: Run Cypress tests - PR
runs-on: self-hosted runs-on: self-hosted
timeout-minutes: 30 timeout-minutes: 60
steps: steps:
# Add GOBIN to PATH # Add GOBIN to PATH
- name: Add GOBIN to PATH - name: Add GOBIN to PATH
@ -82,7 +84,7 @@ jobs:
working-directory: frontend-monorepo working-directory: frontend-monorepo
- name: Run Cypress tests - name: Run Cypress tests
run: npx nx token-e2e:e2e --record --key ${{ secrets.CYPRESS_RECORD_KEY }} --browser chrome ${{ inputs.tags }} run: npx nx run token-e2e:e2e ${{ inputs.skip-cache }} --record --key ${{ secrets.CYPRESS_RECORD_KEY }} --browser chrome ${{ inputs.tags }}
working-directory: frontend-monorepo working-directory: frontend-monorepo
env: env:
CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE: ${{ secrets.CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE }} CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE: ${{ secrets.CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE }}

View File

@ -10,6 +10,9 @@ on:
required: false required: false
type: string type: string
default: /home/runner/go/bin default: /home/runner/go/bin
skip-cache:
required: false
type: string
tags: tags:
required: false required: false
type: string type: string
@ -39,6 +42,11 @@ jobs:
/home/runner/.cache/Cypress /home/runner/.cache/Cypress
key: node_modules_cypress-${{ hashFiles('frontend-monorepo/yarn.lock') }} key: node_modules_cypress-${{ hashFiles('frontend-monorepo/yarn.lock') }}
# Install frontend dependencies
- name: Install root dependencies
run: yarn install --frozen-lockfile
working-directory: frontend-monorepo
####### #######
## Build and run Vegacapsule network ## Build and run Vegacapsule network
####### #######
@ -67,10 +75,9 @@ jobs:
working-directory: frontend-monorepo working-directory: frontend-monorepo
- name: Run Cypress tests - name: Run Cypress tests
run: npx nx run trading-e2e:e2e --record --key ${{ secrets.CYPRESS_RECORD_KEY }} --browser chrome ${{ inputs.tags }} run: npx nx run trading-e2e:e2e ${{ inputs.skip-cache }} --record --key ${{ secrets.CYPRESS_RECORD_KEY }} --browser chrome ${{ inputs.tags }}
working-directory: frontend-monorepo working-directory: frontend-monorepo
env: env:
CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE: ${{ secrets.CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE }} CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE: ${{ secrets.CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE }}
CYPRESS_SLACK_WEBHOOK: ${{ secrets.CYPRESS_SLACK_WEBHOOK }} CYPRESS_SLACK_WEBHOOK: ${{ secrets.CYPRESS_SLACK_WEBHOOK }}
CYPRESS_ETH_WALLET_MNEMONIC: ${{ secrets.CYPRESS_ETH_WALLET_MNEMONIC }} CYPRESS_ETH_WALLET_MNEMONIC: ${{ secrets.CYPRESS_ETH_WALLET_MNEMONIC }}
CYPRESS_TEARDOWN_NETWORK_AFTER_FLOWS: false

74
.github/workflows/tests-dispatcher.yml vendored Normal file
View File

@ -0,0 +1,74 @@
on:
workflow_call:
inputs:
project:
required: true
type: string
vega-version:
required: true
type: string
gobin:
required: false
type: string
default: /home/runner/go/bin
skip-cache:
required: false
type: string
tags:
required: false
type: string
night-run:
required: false
type: boolean
jobs:
run-console-lite-e2e:
if: ${{ contains(inputs.project, 'console-lite-e2e') || contains(inputs.project, 'console-lite') }}
uses: ./.github/workflows/cypress-console-lite-e2e.yml
secrets: inherit
with:
vega-version: ${{ inputs.vega-version }}
gobin: ${{ inputs.gobin }}
skip-cache: ${{ inputs.skip-cache }}
tags: ${{ inputs.tags }}
run-explorer-e2e:
if: ${{ contains(inputs.project, 'explorer-e2e') || contains(inputs.project, 'explorer') }}
uses: ./.github/workflows/cypress-explorer-e2e.yml
secrets: inherit
with:
vega-version: ${{ inputs.vega-version }}
gobin: ${{ inputs.gobin }}
skip-cache: ${{ inputs.skip-cache }}
tags: ${{ inputs.tags }}
night-run: ${{ inputs.night-run }}
run-liquidity-e2e:
if: ${{ contains(inputs.project, 'liquidity-provision-dashboard-e2e') || contains(inputs.project, 'liquidity-provision-dashboard') }}
uses: ./.github/workflows/cypress-liquidity-provision-dashboard-e2e.yml
secrets: inherit
run-stats-e2e:
if: ${{ contains(inputs.project, 'stats-e2e') || contains(inputs.project, 'stats') }}
uses: ./.github/workflows/cypress-stats-e2e.yml
secrets: inherit
run-token-e2e:
if: ${{ contains(inputs.project, 'token-e2e') || contains(inputs.project, 'token') }}
uses: ./.github/workflows/cypress-token-e2e.yml
secrets: inherit
with:
vega-version: ${{ inputs.vega-version }}
gobin: ${{ inputs.gobin }}
skip-cache: ${{ inputs.skip-cache }}
tags: ${{ inputs.tags }}
run-trading-e2e:
if: ${{ contains(inputs.project, 'trading-e2e') || contains(inputs.project, 'trading') }}
uses: ./.github/workflows/cypress-trading-e2e.yml
secrets: inherit
with:
vega-version: ${{ inputs.vega-version }}
gobin: ${{ inputs.gobin }}
skip-cache: ${{ inputs.skip-cache }}
tags: ${{ inputs.tags }}