Chore/1495 workflows minor improvements fixes and cleanup (#1538)
* test: try with shared actions * test: fix env * test: fix path * test: fix path * test: fix path * test: fix path * test: fix path * test: fix path * test: fix path * test: fix path * test: fix path * test: fix path * test: fix path * test: create action for capsule build * test: create action for capsule build * test: create action for capsule build * test: create action for capsule build * fix: fix * fix: fix * fix: fix * fix: fix * chore: create action for vegawallet setup * chore: create action for vegawallet setup * chore: fix * chore: fix * chore: fix * chore: fix * fix: fix * fix: fix * fix: fix * fix: fix * fix: fix * fix: fix * fix: fix * fix: fix * fix: fix * fix: fix * chore: apply changes to all workflows * chore: apply changes to all workflows
This commit is contained in:
parent
446af23d9c
commit
93c1835cd6
31
.github/actions/install-vega-binaries/action.yml
vendored
Normal file
31
.github/actions/install-vega-binaries/action.yml
vendored
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
inputs:
|
||||||
|
all:
|
||||||
|
description: 'Install all binaries'
|
||||||
|
default: false
|
||||||
|
version:
|
||||||
|
description: 'Vega version'
|
||||||
|
gobin:
|
||||||
|
description: 'GOBIN path'
|
||||||
|
default: '/home/runner/go/bin'
|
||||||
|
runs:
|
||||||
|
using: 'composite'
|
||||||
|
steps:
|
||||||
|
- name: Install Vega binaries
|
||||||
|
if: ${{ inputs.all }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
wget 'https://github.com/vegaprotocol/vega/releases/download/${{ env.VEGA_VERSION }}/vega-linux-amd64.zip' -q
|
||||||
|
unzip vega-linux-amd64.zip -d ${{ inputs.gobin }}
|
||||||
|
|
||||||
|
- name: Install date-node binaries
|
||||||
|
if: ${{ inputs.all }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
wget 'https://github.com/vegaprotocol/vega/releases/download/${{ env.VEGA_VERSION }}/data-node-linux-amd64.zip' -q
|
||||||
|
unzip data-node-linux-amd64.zip -d ${{ inputs.gobin }}
|
||||||
|
|
||||||
|
- name: Install Vega wallet binaries
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
wget 'https://github.com/vegaprotocol/vega/releases/download/${{ env.VEGA_VERSION }}/vegawallet-linux-amd64.zip' -q
|
||||||
|
unzip vegawallet-linux-amd64.zip -d ${{ inputs.gobin }}
|
30
.github/actions/run-vegacapsule/action.yml
vendored
Normal file
30
.github/actions/run-vegacapsule/action.yml
vendored
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
inputs:
|
||||||
|
github-token:
|
||||||
|
description: 'github token'
|
||||||
|
runs:
|
||||||
|
using: 'composite'
|
||||||
|
steps:
|
||||||
|
- name: Checkout capsule
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
repository: vegaprotocol/vegacapsule
|
||||||
|
ref: main
|
||||||
|
token: ${{ inputs.github-token }}
|
||||||
|
path: './capsule'
|
||||||
|
|
||||||
|
- name: Build capsule
|
||||||
|
run: go install
|
||||||
|
shell: bash
|
||||||
|
working-directory: capsule
|
||||||
|
|
||||||
|
- name: Login to docker
|
||||||
|
shell: bash
|
||||||
|
run: echo -n ${{ inputs.github-token }} | docker login https://ghcr.io -u vega-ci-bot --password-stdin
|
||||||
|
|
||||||
|
- name: Start nomad
|
||||||
|
shell: bash
|
||||||
|
run: vegacapsule nomad &
|
||||||
|
|
||||||
|
- name: Bootstrap network
|
||||||
|
shell: bash
|
||||||
|
run: vegacapsule network bootstrap --config-path=./frontend-monorepo/vegacapsule/config.hcl --force
|
45
.github/actions/setup-vegawallet/action.yml
vendored
Normal file
45
.github/actions/setup-vegawallet/action.yml
vendored
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
inputs:
|
||||||
|
recovery:
|
||||||
|
description: 'Recovery phrase'
|
||||||
|
passphrase:
|
||||||
|
description: 'Wallet password'
|
||||||
|
capsule:
|
||||||
|
description: 'Is Capsule network used'
|
||||||
|
default: false
|
||||||
|
runs:
|
||||||
|
using: 'composite'
|
||||||
|
steps:
|
||||||
|
- name: Create passphrase
|
||||||
|
shell: bash
|
||||||
|
run: echo "${{ inputs.passphrase }}" > ./passphrase
|
||||||
|
|
||||||
|
- name: Create recovery
|
||||||
|
shell: bash
|
||||||
|
run: echo "${{ inputs.recovery }}" > ./recovery
|
||||||
|
|
||||||
|
- name: Initialize wallet
|
||||||
|
shell: bash
|
||||||
|
run: vegawallet init -f --home ~/.vegacapsule/testnet/wallet
|
||||||
|
|
||||||
|
- name: Import wallet
|
||||||
|
shell: bash
|
||||||
|
run: vegawallet import -w UI_Trading_Test --recovery-phrase-file ./recovery -p ./passphrase --home ~/.vegacapsule/testnet/wallet
|
||||||
|
|
||||||
|
- name: Create public key 2
|
||||||
|
shell: bash
|
||||||
|
run: vegawallet key generate -w UI_Trading_Test -p ./passphrase --home ~/.vegacapsule/testnet/wallet
|
||||||
|
|
||||||
|
- name: Import fairground network
|
||||||
|
shell: bash
|
||||||
|
if: ${{ inputs.capsule==false }}
|
||||||
|
run: vegawallet network import --from-url="https://raw.githubusercontent.com/vegaprotocol/networks/master/fairground/fairground.toml" --force --home ~/.vegacapsule/testnet/wallet
|
||||||
|
|
||||||
|
- name: Start service using fairground network
|
||||||
|
shell: bash
|
||||||
|
if: ${{ inputs.capsule==false }}
|
||||||
|
run: vegawallet service run --network fairground --automatic-consent --home ~/.vegacapsule/testnet/wallet &
|
||||||
|
|
||||||
|
- name: Start service using capsule network
|
||||||
|
shell: bash
|
||||||
|
if: ${{ inputs.capsule }}
|
||||||
|
run: vegawallet service run --network DV --automatic-consent --home ~/.vegacapsule/testnet/wallet &
|
111
.github/workflows/capsule-cypress-manual-trigger.yml
vendored
111
.github/workflows/capsule-cypress-manual-trigger.yml
vendored
@ -1,4 +1,4 @@
|
|||||||
name: Capsule tests -- manual trigger
|
name: Cypress tests -- manual trigger
|
||||||
|
|
||||||
# This workflow runs the frontend tests against chosen branch
|
# This workflow runs the frontend tests against chosen branch
|
||||||
|
|
||||||
@ -23,10 +23,11 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
manual:
|
manual:
|
||||||
name: Run capsule tests -- manual trigger
|
name: Run Cypress tests -- manual trigger
|
||||||
runs-on: self-hosted
|
runs-on: self-hosted
|
||||||
env:
|
env:
|
||||||
GO111MODULE: 'on'
|
GO111MODULE: 'on'
|
||||||
|
GOBIN: /home/runner/go/bin
|
||||||
VEGA_VERSION: 'v0.57.0'
|
VEGA_VERSION: 'v0.57.0'
|
||||||
steps:
|
steps:
|
||||||
#######
|
#######
|
||||||
@ -37,6 +38,7 @@ jobs:
|
|||||||
id: go
|
id: go
|
||||||
with:
|
with:
|
||||||
go-version: 1.19
|
go-version: 1.19
|
||||||
|
|
||||||
- name: Set up Node 16
|
- name: Set up Node 16
|
||||||
uses: actions/setup-node@v2
|
uses: actions/setup-node@v2
|
||||||
id: npm
|
id: npm
|
||||||
@ -57,25 +59,14 @@ jobs:
|
|||||||
- name: Checkout frontend mono repo
|
- name: Checkout frontend mono repo
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
ref: ${{ github.event.pull_request.head.ref }}
|
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
path: './frontend-monorepo'
|
path: './frontend-monorepo'
|
||||||
|
|
||||||
# See if we capsule is needed for this project
|
# See if we capsule is needed for this project
|
||||||
- name: See if capsule is necessary
|
- name: Set capsule flag if necessary
|
||||||
if: ${{ github.event.inputs.project == 'explorer-e2e' || github.event.inputs.project == 'token-e2e' }}
|
if: ${{ github.event.inputs.project == 'explorer-e2e' || github.event.inputs.project == 'token-e2e' }}
|
||||||
run: echo RUN_CAPSULE=true >> $GITHUB_ENV
|
run: echo RUN_CAPSULE=true >> $GITHUB_ENV
|
||||||
|
|
||||||
# Checkout capsule to build local network
|
|
||||||
- name: Checkout capsule
|
|
||||||
if: ${{ env.RUN_CAPSULE }}
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
repository: vegaprotocol/vegacapsule
|
|
||||||
ref: main
|
|
||||||
token: ${{ secrets.VEGA_CI_BOT_GITHUB_TOKEN }}
|
|
||||||
path: './capsule'
|
|
||||||
|
|
||||||
# Restore node_modules from cache if possible
|
# Restore node_modules from cache if possible
|
||||||
- name: Restore node_modules from cache
|
- name: Restore node_modules from cache
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
@ -91,98 +82,48 @@ jobs:
|
|||||||
working-directory: frontend-monorepo
|
working-directory: frontend-monorepo
|
||||||
|
|
||||||
#######
|
#######
|
||||||
## Build binaries
|
## Build and run Vegacapsule network
|
||||||
#######
|
#######
|
||||||
- name: Build capsule
|
|
||||||
if: ${{ env.RUN_CAPSULE }}
|
|
||||||
run: go install
|
|
||||||
working-directory: capsule
|
|
||||||
|
|
||||||
- name: Set GOBIN
|
|
||||||
run: echo GOBIN=$(go env GOPATH)/bin >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Install Vega binaries
|
- name: Install Vega binaries
|
||||||
if: ${{ env.RUN_CAPSULE }}
|
uses: ./frontend-monorepo/.github/actions/install-vega-binaries
|
||||||
run: |
|
with:
|
||||||
wget 'https://github.com/vegaprotocol/vega/releases/download/${{ env.VEGA_VERSION }}/vega-linux-amd64.zip'
|
all: ${{ env.RUN_CAPSULE }}
|
||||||
unzip vega-linux-amd64.zip -d ${{ env.GOBIN }}
|
version: ${{ env.VEGA_VERSION }}
|
||||||
|
gobin: ${{ env.GOBIN }}
|
||||||
|
|
||||||
- name: Install date-node binaries
|
- name: Build and run Vegacapsule network
|
||||||
if: ${{ env.RUN_CAPSULE }}
|
if: ${{ env.RUN_CAPSULE }}
|
||||||
run: |
|
uses: ./frontend-monorepo/.github/actions/run-vegacapsule
|
||||||
wget 'https://github.com/vegaprotocol/vega/releases/download/${{ env.VEGA_VERSION }}/data-node-linux-amd64.zip'
|
with:
|
||||||
unzip data-node-linux-amd64.zip -d ${{ env.GOBIN }}
|
github-token: ${{ secrets.VEGA_CI_BOT_GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Install Vega wallet binaries
|
|
||||||
run: |
|
|
||||||
wget 'https://github.com/vegaprotocol/vega/releases/download/${{ env.VEGA_VERSION }}/vegawallet-linux-amd64.zip'
|
|
||||||
unzip vegawallet-linux-amd64.zip -d ${{ env.GOBIN }}
|
|
||||||
|
|
||||||
######
|
|
||||||
## Start capsule
|
|
||||||
######
|
|
||||||
- name: Login to docker
|
|
||||||
if: ${{ env.RUN_CAPSULE }}
|
|
||||||
run: echo -n ${{ secrets.VEGA_CI_BOT_GITHUB_TOKEN }} | docker login https://ghcr.io -u vega-ci-bot --password-stdin
|
|
||||||
|
|
||||||
- name: Start nomad
|
|
||||||
if: ${{ env.RUN_CAPSULE }}
|
|
||||||
run: vegacapsule nomad &
|
|
||||||
|
|
||||||
- name: Bootstrap network
|
|
||||||
if: ${{ env.RUN_CAPSULE }}
|
|
||||||
run: vegacapsule network bootstrap --config-path=../frontend-monorepo/vegacapsule/config.hcl --force
|
|
||||||
working-directory: capsule
|
|
||||||
|
|
||||||
######
|
######
|
||||||
## Setup a Vega wallet for our user
|
## Setup a Vega wallet for our user
|
||||||
######
|
######
|
||||||
- name: Create passphrase
|
|
||||||
run: echo "${{ secrets.CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE }}" > ./passphrase
|
|
||||||
- name: Create recovery
|
|
||||||
run: echo "${{ secrets.TRADING_TEST_VEGA_WALLET_RECOVERY }}" > ./recovery
|
|
||||||
|
|
||||||
- name: Initialize wallet
|
- name: Set up Vegawallet
|
||||||
run: vegawallet init -f --home ~/.vegacapsule/testnet/wallet
|
uses: ./frontend-monorepo/.github/actions/setup-vegawallet
|
||||||
- name: Import wallet
|
with:
|
||||||
run: vegawallet import -w UI_Trading_Test --recovery-phrase-file ./recovery -p ./passphrase --home ~/.vegacapsule/testnet/wallet
|
recovery: ${{ secrets.TRADING_TEST_VEGA_WALLET_RECOVERY }}
|
||||||
- name: Create public key 2
|
passphrase: ${{ secrets.CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE }}
|
||||||
run: vegawallet key generate -w UI_Trading_Test -p ./passphrase --home ~/.vegacapsule/testnet/wallet
|
capsule: ${{ env.RUN_CAPSULE }}
|
||||||
|
|
||||||
- name: Import fairground network
|
|
||||||
if: ${{ env.RUN_CAPSULE==false }}
|
|
||||||
run: vegawallet network import --from-url="https://raw.githubusercontent.com/vegaprotocol/networks/master/fairground/fairground.toml" --force --home ~/.vegacapsule/testnet/wallet
|
|
||||||
|
|
||||||
- name: Start service using fairground network
|
|
||||||
if: ${{ env.RUN_CAPSULE==false }}
|
|
||||||
run: vegawallet service run --network fairground --automatic-consent --home ~/.vegacapsule/testnet/wallet &
|
|
||||||
|
|
||||||
- name: Start service using capsule network
|
|
||||||
if: ${{ env.RUN_CAPSULE }}
|
|
||||||
run: vegawallet service run --network DV --automatic-consent --home ~/.vegacapsule/testnet/wallet &
|
|
||||||
|
|
||||||
######
|
######
|
||||||
## Run some tests
|
## Run some tests
|
||||||
######
|
######
|
||||||
|
|
||||||
|
- name: Set smoke tag if necessary
|
||||||
|
if: ${{ inputs.runAlltests==false }}
|
||||||
|
run: echo TAGS="--env.grepTags @smoke" >> $GITHUB_ENV
|
||||||
|
|
||||||
# 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
|
||||||
working-directory: frontend-monorepo
|
working-directory: frontend-monorepo
|
||||||
|
|
||||||
- name: Run smoke Cypress tests
|
|
||||||
if: ${{ github.event.inputs.runAlltests == 'true' }}
|
|
||||||
run: yarn nx run ${{ github.event.inputs.project }}: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.CYPESS_ETH_WALLET_MNEMONIC }}
|
|
||||||
CYPRESS_TEARDOWN_NETWORK_AFTER_FLOWS: true
|
|
||||||
|
|
||||||
- name: Run Cypress tests
|
- name: Run Cypress tests
|
||||||
if: ${{ github.event.inputs.runAlltests == 'false' }}
|
run: yarn nx run ${{ github.event.inputs.project }}:e2e --record --key ${{ secrets.CYPRESS_RECORD_KEY }} --browser chrome ${{ env.TAGS }}
|
||||||
run: yarn nx run ${{ github.event.inputs.project }}:e2e --record --key ${{ secrets.CYPRESS_RECORD_KEY }} --browser chrome
|
|
||||||
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 }}
|
||||||
|
78
.github/workflows/capsule-cypress-night-run.yml
vendored
78
.github/workflows/capsule-cypress-night-run.yml
vendored
@ -1,4 +1,4 @@
|
|||||||
name: Capsule tests -- night run
|
name: Cypress tests -- night run
|
||||||
|
|
||||||
# This workflow runs the frontend tests against latest develop of the core to preempt breaking changes
|
# This workflow runs the frontend tests against latest develop of the core to preempt breaking changes
|
||||||
|
|
||||||
@ -8,11 +8,14 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
nightly:
|
nightly:
|
||||||
name: Run capsule tests -- nightly
|
name: Run Cypress tests -- nightly
|
||||||
runs-on: self-hosted
|
runs-on: self-hosted
|
||||||
|
timeout-minutes: 60
|
||||||
env:
|
env:
|
||||||
GO111MODULE: 'on'
|
GO111MODULE: 'on'
|
||||||
|
GOBIN: /home/runner/go/bin
|
||||||
VEGA_VERSION: 'v0.57.0'
|
VEGA_VERSION: 'v0.57.0'
|
||||||
|
RUN_CAPSULE: true
|
||||||
steps:
|
steps:
|
||||||
#######
|
#######
|
||||||
## Setup langs
|
## Setup langs
|
||||||
@ -42,19 +45,9 @@ jobs:
|
|||||||
- name: Checkout frontend mono repo
|
- name: Checkout frontend mono repo
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
ref: ${{ github.event.pull_request.head.ref }}
|
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
path: './frontend-monorepo'
|
path: './frontend-monorepo'
|
||||||
|
|
||||||
# Checkout capsule to build local network
|
|
||||||
- name: Checkout capsule
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
repository: vegaprotocol/vegacapsule
|
|
||||||
ref: main
|
|
||||||
token: ${{ secrets.VEGA_CI_BOT_GITHUB_TOKEN }}
|
|
||||||
path: './capsule'
|
|
||||||
|
|
||||||
# Restore node_modules from cache if possible
|
# Restore node_modules from cache if possible
|
||||||
- name: Restore node_modules from cache
|
- name: Restore node_modules from cache
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
@ -70,59 +63,32 @@ jobs:
|
|||||||
working-directory: frontend-monorepo
|
working-directory: frontend-monorepo
|
||||||
|
|
||||||
#######
|
#######
|
||||||
## Build binaries
|
## Build and run Vegacapsule network
|
||||||
#######
|
#######
|
||||||
- name: Build capsule
|
|
||||||
run: go install
|
|
||||||
working-directory: capsule
|
|
||||||
|
|
||||||
- name: Set GOBIN
|
|
||||||
run: echo GOBIN=$(go env GOPATH)/bin >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Install Vega binaries
|
- name: Install Vega binaries
|
||||||
run: |
|
uses: ./frontend-monorepo/.github/actions/install-vega-binaries
|
||||||
wget 'https://github.com/vegaprotocol/vega/releases/download/${{ env.VEGA_VERSION }}/vega-linux-amd64.zip'
|
with:
|
||||||
unzip vega-linux-amd64.zip -d ${{ env.GOBIN }}
|
all: ${{ env.RUN_CAPSULE }}
|
||||||
|
version: ${{ env.VEGA_VERSION }}
|
||||||
|
gobin: ${{ env.GOBIN }}
|
||||||
|
|
||||||
- name: Install date-node binaries
|
- name: Build and run Vegacapsule network
|
||||||
run: |
|
if: ${{ env.RUN_CAPSULE }}
|
||||||
wget 'https://github.com/vegaprotocol/vega/releases/download/${{ env.VEGA_VERSION }}/data-node-linux-amd64.zip'
|
uses: ./frontend-monorepo/.github/actions/run-vegacapsule
|
||||||
unzip data-node-linux-amd64.zip -d ${{ env.GOBIN }}
|
with:
|
||||||
|
github-token: ${{ secrets.VEGA_CI_BOT_GITHUB_TOKEN }}
|
||||||
- name: Install Vega wallet binaries
|
|
||||||
run: |
|
|
||||||
wget 'https://github.com/vegaprotocol/vega/releases/download/${{ env.VEGA_VERSION }}/vegawallet-linux-amd64.zip'
|
|
||||||
unzip vegawallet-linux-amd64.zip -d ${{ env.GOBIN }}
|
|
||||||
|
|
||||||
######
|
|
||||||
## Start capsule
|
|
||||||
######
|
|
||||||
- name: Login to docker
|
|
||||||
run: echo -n ${{ secrets.VEGA_CI_BOT_GITHUB_TOKEN }} | docker login https://ghcr.io -u vega-ci-bot --password-stdin
|
|
||||||
|
|
||||||
- name: Start nomad
|
|
||||||
run: vegacapsule nomad &
|
|
||||||
|
|
||||||
- name: Bootstrap network
|
|
||||||
run: vegacapsule network bootstrap --config-path=../frontend-monorepo/vegacapsule/config.hcl --force
|
|
||||||
working-directory: capsule
|
|
||||||
|
|
||||||
######
|
######
|
||||||
## Setup a Vega wallet for our user
|
## Setup a Vega wallet for our user
|
||||||
######
|
######
|
||||||
- name: Create passphrase
|
|
||||||
run: echo "${{ secrets.CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE }}" > ./passphrase
|
|
||||||
- name: Create recovery
|
|
||||||
run: echo "${{ secrets.TRADING_TEST_VEGA_WALLET_RECOVERY }}" > ./recovery
|
|
||||||
|
|
||||||
- name: Initialize wallet
|
- name: Set up Vegawallet
|
||||||
run: vegawallet init -f --home ~/.vegacapsule/testnet/wallet
|
uses: ./frontend-monorepo/.github/actions/setup-vegawallet
|
||||||
- name: Import wallet
|
with:
|
||||||
run: vegawallet import -w UI_Trading_Test --recovery-phrase-file ./recovery -p ./passphrase --home ~/.vegacapsule/testnet/wallet
|
recovery: ${{ secrets.TRADING_TEST_VEGA_WALLET_RECOVERY }}
|
||||||
- name: Create public key 2
|
passphrase: ${{ secrets.CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE }}
|
||||||
run: vegawallet key generate -w UI_Trading_Test -p ./passphrase --home ~/.vegacapsule/testnet/wallet
|
capsule: ${{ env.RUN_CAPSULE }}
|
||||||
- name: Start service
|
|
||||||
run: vegawallet service run --network DV --automatic-consent --home ~/.vegacapsule/testnet/wallet &
|
|
||||||
|
|
||||||
######
|
######
|
||||||
## Run some tests
|
## Run some tests
|
||||||
|
125
.github/workflows/capsule-cypress.yml
vendored
125
.github/workflows/capsule-cypress.yml
vendored
@ -1,4 +1,4 @@
|
|||||||
name: Capsule tests
|
name: Cypress tests
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@ -14,10 +14,12 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
pr:
|
pr:
|
||||||
name: Run capsule tests - PR
|
name: Run Cypress tests - PR
|
||||||
runs-on: self-hosted
|
runs-on: self-hosted
|
||||||
|
timeout-minutes: 30
|
||||||
env:
|
env:
|
||||||
GO111MODULE: 'on'
|
GO111MODULE: 'on'
|
||||||
|
GOBIN: /home/runner/go/bin
|
||||||
VEGA_VERSION: 'v0.57.0'
|
VEGA_VERSION: 'v0.57.0'
|
||||||
steps:
|
steps:
|
||||||
#######
|
#######
|
||||||
@ -28,6 +30,7 @@ jobs:
|
|||||||
id: go
|
id: go
|
||||||
with:
|
with:
|
||||||
go-version: 1.19
|
go-version: 1.19
|
||||||
|
|
||||||
- name: Set up Node 16
|
- name: Set up Node 16
|
||||||
uses: actions/setup-node@v2
|
uses: actions/setup-node@v2
|
||||||
id: npm
|
id: npm
|
||||||
@ -48,10 +51,26 @@ jobs:
|
|||||||
- name: Checkout frontend mono repo
|
- name: Checkout frontend mono repo
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
ref: ${{ github.event.pull_request.head.ref }}
|
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
path: './frontend-monorepo'
|
path: './frontend-monorepo'
|
||||||
|
|
||||||
|
# Check SHAs
|
||||||
|
- name: Derive appropriate SHAs for base and head for `nx affected` commands
|
||||||
|
uses: nrwl/nx-set-shas@v2
|
||||||
|
with:
|
||||||
|
working-directory: frontend-monorepo
|
||||||
|
main-branch-name: ${{ github.base_ref || github.ref_name }}
|
||||||
|
set-environment-variables-for-job: true
|
||||||
|
|
||||||
|
# See if we capsule is needed for this project
|
||||||
|
- name: See affected apps
|
||||||
|
run: echo AFFECTED=$(yarn nx print-affected --base=origin/${{ env.NX_BASE }} --head=${{ env.NX_HEAD }} --select=projects) >> $GITHUB_ENV
|
||||||
|
working-directory: frontend-monorepo
|
||||||
|
|
||||||
|
- name: See if capsule is necessary
|
||||||
|
if: ${{ contains(env.AFFECTED, 'token') || contains(env.AFFECTED, 'token-e2e') || contains(env.AFFECTED, 'explorer') || contains(env.AFFECTED, 'explorer-e2e') }}
|
||||||
|
run: echo RUN_CAPSULE=true >> $GITHUB_ENV
|
||||||
|
|
||||||
# Restore node_modules from cache if possible
|
# Restore node_modules from cache if possible
|
||||||
- name: Restore node_modules from cache
|
- name: Restore node_modules from cache
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
@ -66,106 +85,38 @@ jobs:
|
|||||||
run: yarn install --frozen-lockfile
|
run: yarn install --frozen-lockfile
|
||||||
working-directory: frontend-monorepo
|
working-directory: frontend-monorepo
|
||||||
|
|
||||||
# See affected apps to see if building all binaries is necessary
|
|
||||||
- name: See affected apps
|
|
||||||
run: echo AFFECTED=$(yarn nx print-affected --base=origin/${{github.base_ref}} --head=${{github.head_ref}} --select=projects) >> $GITHUB_ENV
|
|
||||||
working-directory: frontend-monorepo
|
|
||||||
|
|
||||||
- name: See if capsule is necessary
|
|
||||||
if: ${{ contains(env.AFFECTED, 'token') || contains(env.AFFECTED, 'token-e2e') || contains(env.AFFECTED, 'explorer') || contains(env.AFFECTED, 'explorer-e2e') }}
|
|
||||||
run: echo RUN_CAPSULE=true >> $GITHUB_ENV
|
|
||||||
|
|
||||||
# Checkout capsule to build local network
|
|
||||||
- name: Checkout capsule
|
|
||||||
if: ${{ env.RUN_CAPSULE }}
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
repository: vegaprotocol/vegacapsule
|
|
||||||
ref: main
|
|
||||||
token: ${{ secrets.VEGA_CI_BOT_GITHUB_TOKEN }}
|
|
||||||
path: './capsule'
|
|
||||||
|
|
||||||
#######
|
#######
|
||||||
## Build binaries
|
## Build and run Vegacapsule network
|
||||||
#######
|
#######
|
||||||
- name: Build capsule
|
|
||||||
if: ${{ env.RUN_CAPSULE }}
|
|
||||||
run: go install
|
|
||||||
working-directory: capsule
|
|
||||||
|
|
||||||
- name: Set GOBIN
|
|
||||||
run: echo GOBIN=$(go env GOPATH)/bin >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Install Vega binaries
|
- name: Install Vega binaries
|
||||||
if: ${{ env.RUN_CAPSULE }}
|
uses: ./frontend-monorepo/.github/actions/install-vega-binaries
|
||||||
run: |
|
with:
|
||||||
wget 'https://github.com/vegaprotocol/vega/releases/download/${{ env.VEGA_VERSION }}/vega-linux-amd64.zip'
|
all: ${{ env.RUN_CAPSULE }}
|
||||||
unzip vega-linux-amd64.zip -d ${{ env.GOBIN }}
|
version: ${{ env.VEGA_VERSION }}
|
||||||
|
gobin: ${{ env.GOBIN }}
|
||||||
|
|
||||||
- name: Install date-node binaries
|
- name: Build and run Vegacapsule network
|
||||||
if: ${{ env.RUN_CAPSULE }}
|
if: ${{ env.RUN_CAPSULE }}
|
||||||
run: |
|
uses: ./frontend-monorepo/.github/actions/run-vegacapsule
|
||||||
wget 'https://github.com/vegaprotocol/vega/releases/download/${{ env.VEGA_VERSION }}/data-node-linux-amd64.zip'
|
with:
|
||||||
unzip data-node-linux-amd64.zip -d ${{ env.GOBIN }}
|
github-token: ${{ secrets.VEGA_CI_BOT_GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Install Vega wallet binaries
|
|
||||||
run: |
|
|
||||||
wget 'https://github.com/vegaprotocol/vega/releases/download/${{ env.VEGA_VERSION }}/vegawallet-linux-amd64.zip'
|
|
||||||
unzip vegawallet-linux-amd64.zip -d ${{ env.GOBIN }}
|
|
||||||
|
|
||||||
######
|
|
||||||
## Start capsule
|
|
||||||
######
|
|
||||||
- name: Login to docker
|
|
||||||
if: ${{ env.RUN_CAPSULE }}
|
|
||||||
run: echo -n ${{ secrets.VEGA_CI_BOT_GITHUB_TOKEN }} | docker login https://ghcr.io -u vega-ci-bot --password-stdin
|
|
||||||
|
|
||||||
- name: Start nomad
|
|
||||||
if: ${{ env.RUN_CAPSULE }}
|
|
||||||
run: vegacapsule nomad &
|
|
||||||
|
|
||||||
- name: Bootstrap network
|
|
||||||
if: ${{ env.RUN_CAPSULE }}
|
|
||||||
run: vegacapsule network bootstrap --config-path=../frontend-monorepo/vegacapsule/config.hcl --force
|
|
||||||
working-directory: capsule
|
|
||||||
|
|
||||||
######
|
######
|
||||||
## Setup a Vega wallet for our user
|
## Setup a Vega wallet for our user
|
||||||
######
|
######
|
||||||
- name: Create passphrase
|
|
||||||
run: echo "${{ secrets.CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE }}" > ./passphrase
|
|
||||||
- name: Create recovery
|
|
||||||
run: echo "${{ secrets.TRADING_TEST_VEGA_WALLET_RECOVERY }}" > ./recovery
|
|
||||||
|
|
||||||
- name: Initialize wallet
|
- name: Set up Vegawallet
|
||||||
run: vegawallet init -f --home ~/.vegacapsule/testnet/wallet
|
uses: ./frontend-monorepo/.github/actions/setup-vegawallet
|
||||||
- name: Import wallet
|
with:
|
||||||
run: vegawallet import -w UI_Trading_Test --recovery-phrase-file ./recovery -p ./passphrase --home ~/.vegacapsule/testnet/wallet
|
recovery: ${{ secrets.TRADING_TEST_VEGA_WALLET_RECOVERY }}
|
||||||
- name: Create public key 2
|
passphrase: ${{ secrets.CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE }}
|
||||||
run: vegawallet key generate -w UI_Trading_Test -p ./passphrase --home ~/.vegacapsule/testnet/wallet
|
capsule: ${{ env.RUN_CAPSULE }}
|
||||||
|
|
||||||
- name: Import fairground network
|
|
||||||
if: ${{ env.RUN_CAPSULE==false }}
|
|
||||||
run: vegawallet network import --from-url="https://raw.githubusercontent.com/vegaprotocol/networks/master/fairground/fairground.toml" --force --home ~/.vegacapsule/testnet/wallet
|
|
||||||
|
|
||||||
- name: Start service using fairground network
|
|
||||||
if: ${{ env.RUN_CAPSULE==false }}
|
|
||||||
run: vegawallet service run --network fairground --automatic-consent --home ~/.vegacapsule/testnet/wallet &
|
|
||||||
|
|
||||||
- name: Start service using capsule network
|
|
||||||
if: ${{ env.RUN_CAPSULE }}
|
|
||||||
run: vegawallet service run --network DV --automatic-consent --home ~/.vegacapsule/testnet/wallet &
|
|
||||||
|
|
||||||
######
|
######
|
||||||
## Run some tests
|
## Run some tests
|
||||||
######
|
######
|
||||||
|
|
||||||
- name: Derive appropriate SHAs for base and head for `nx affected` commands
|
|
||||||
uses: nrwl/nx-set-shas@v2
|
|
||||||
with:
|
|
||||||
working-directory: frontend-monorepo
|
|
||||||
main-branch-name: ${{github.base_ref}}
|
|
||||||
|
|
||||||
# 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
|
||||||
|
Loading…
Reference in New Issue
Block a user