Skip to content

Launch Chopsticks forking Kusama and an indexer pointed at it in tests #292

Launch Chopsticks forking Kusama and an indexer pointed at it in tests

Launch Chopsticks forking Kusama and an indexer pointed at it in tests #292

Workflow file for this run

name: Cypress tests
on:
pull_request:
paths:
- 'packages/ui/**/*'
- '.github/workflows/cypress-tests.yaml'
jobs:
cypress-run:
runs-on: ubuntu-latest
container:
image: cypress/browsers:latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/cache@v3
id: yarn-build-cache
with:
path: |
**/node_modules
~/.cache/Cypress
**/build
key: ${{ runner.os }}-node_modules-files-build-${{ hashFiles('./yarn.lock') }}
restore-keys: |
${{ runner.os }}-node_modules-build-
- name: Install and show git version
run: apt-get -y install git && git --version
id: git-install
- name: run chopstick forking kusama
run: npm install --global @acala-network/chopsticks@latest && chopsticks --config ./chopsticks-config.yml
- uses: isbang/[email protected]
with:
compose-file: './docker-compose.yml'
- name: Install indexer deps
run: npm ci
- name: run indexer routine
run: npm run codegen; npm run typegen; npm run build; npm run db:migrate; node -r dotenv/config lib/main dotenv_config_path=assets/envs/.env.chopsticks
- name: Graphql server
run: npm run start:graphql-server
# Install NPM dependencies, cache them correctly
# and run all Cypress tests
- name: Cypress run
uses: cypress-io/github-action@v6
with:
working-directory: packages/ui
install-command: yarn install
start: 'yarn start'
wait-on: 'http://localhost:3333'
# custom test command to run
command: yarn test:ci
env:
VITE_CHAIN_ID: 'kusama'
VITE_NETWORK_NAME: 'kusama'
VITE_WS_PROVIDER: 'ws://localhost:8000'
VITE_GRAPHQL_WS_PROVIDER: 'ws://localhost:4350/graphql'
VITE_GRAPHQL_HTTP_PROVIDER: 'http://localhost:4350/graphql'
# store the screenshots if the tests fail
- name: Store screenshots
uses: actions/upload-artifact@v1
if: failure()
with:
name: cypress-screenshots
path: packages/ui/cypress/screenshots
# store the videos if the tests fail
- name: Store videos
uses: actions/upload-artifact@v1
if: failure()
with:
name: cypress-videos
path: packages/ui/cypress/videos