2022-11-04 13:13:54 +00:00
|
|
|
name: Cypress - token
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_call:
|
|
|
|
inputs:
|
2022-11-08 15:58:46 +00:00
|
|
|
trigger:
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
default: 'false'
|
2022-11-08 10:33:22 +00:00
|
|
|
skip-cache:
|
|
|
|
required: false
|
|
|
|
type: string
|
2022-11-04 13:13:54 +00:00
|
|
|
tags:
|
|
|
|
required: false
|
|
|
|
type: string
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
token-e2e:
|
2022-11-08 15:58:46 +00:00
|
|
|
if: ${{ inputs.trigger == 'true' }}
|
2022-11-04 13:13:54 +00:00
|
|
|
runs-on: self-hosted
|
2022-11-08 10:33:22 +00:00
|
|
|
timeout-minutes: 60
|
2022-11-04 13:13:54 +00:00
|
|
|
steps:
|
|
|
|
# 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') }}
|
|
|
|
|
|
|
|
# Install frontend dependencies
|
|
|
|
- name: Install root dependencies
|
|
|
|
run: yarn install --frozen-lockfile
|
|
|
|
working-directory: frontend-monorepo
|
|
|
|
|
|
|
|
#######
|
|
|
|
## Build and run Vegacapsule network
|
|
|
|
#######
|
|
|
|
|
|
|
|
- name: Build and run Vegacapsule network
|
|
|
|
uses: ./frontend-monorepo/.github/actions/run-vegacapsule
|
|
|
|
|
|
|
|
######
|
|
|
|
## Setup a Vega wallet for our user
|
|
|
|
######
|
|
|
|
|
2022-11-16 15:04:33 +00:00
|
|
|
- name: Set up Vegawallet for docker
|
2022-12-05 16:51:53 +00:00
|
|
|
id: setup-vega
|
2022-11-16 15:04:33 +00:00
|
|
|
uses: ./frontend-monorepo/.github/actions/setup-vegawallet-docker
|
2022-11-04 13:13:54 +00:00
|
|
|
with:
|
|
|
|
passphrase: ${{ secrets.CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE }}
|
|
|
|
|
|
|
|
######
|
|
|
|
## 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
|
2022-11-08 10:33:22 +00:00
|
|
|
run: npx nx run token-e2e:e2e ${{ inputs.skip-cache }} --record --key ${{ secrets.CYPRESS_RECORD_KEY }} --browser chrome ${{ inputs.tags }}
|
2022-11-04 13:13:54 +00:00
|
|
|
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 }}
|
2022-12-05 16:51:53 +00:00
|
|
|
CYPRESS_VEGA_WALLET_API_TOKEN: ${{ steps.setup-vega.outputs.token }}
|
2022-11-04 13:13:54 +00:00
|
|
|
|
|
|
|
######
|
|
|
|
## 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
|