Skip to content

Commit

Permalink
test: add coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastiendan committed Nov 28, 2023
1 parent 6fcb91b commit dfb3d08
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 1 deletion.
39 changes: 39 additions & 0 deletions .github/workflows/test:coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Run test coverage

on:
pull_request:
branches:
- main

jobs:
coverage:
name: Test/Coverage
runs-on: ubuntu-latest-16-core
environment: devnet-1
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up NodeJS
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'

- name: Install npm packages
run: npm ci

- name: Run Frontend test coverage
run: npm run frontend:test:coverage
env:
VITE_ERC20_MESSAGING_CONTRACT_ADDRESS: ${{ vars.ERC20_MESSAGING_CONTRACT_ADDRESS }}
VITE_SUBNET_REGISTRATOR_CONTRACT_ADDRESS: ${{ vars.SUBNET_REGISTRATOR_CONTRACT_ADDRESS }}
VITE_TOPOS_CORE_PROXY_CONTRACT_ADDRESS: ${{ vars.TOPOS_CORE_PROXY_CONTRACT_ADDRESS }}

- name: Run Backend test coverage
run: npm run backend:test:coverage

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,16 @@ dApp Frontend ERC20 Messaging is the web app to transfer ERC20 tokens across any

</div>

<div align="center">

[![codecov](https://codecov.io/gh/topos-protocol/dapp-frontend-erc20-messaging/branch/main/graph/badge.svg?token=FOH2B2GRL9&style=flat)](https://codecov.io/gh/topos-protocol/dapp-frontend-erc20-messaging)
![example workflow](https://github.com/topos-protocol/dapp-frontend-erc20-messaging/actions/workflows/test:e2e.yml/badge.svg)
![docker-build](https://github.com/topos-protocol/dapp-frontend-erc20-messaging/actions/workflows/docker_build_push.yml/badge.svg)
![test](https://github.com/topos-protocol/dapp-frontend-erc20-messaging/actions/workflows/test.yml/badge.svg)
![release](https://img.shields.io/github/v/release/topos-protocol/dapp-frontend-erc20-messaging)
[![](https://dcbadge.vercel.app/api/server/7HZ8F8ykBT?style=flat)](https://discord.gg/7HZ8F8ykBT)

</div>

## Getting Started

Install NodeJS by following the guidelines from the [official NodeJS website](https://nodejs.dev/en/).
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"backend:start": "npm run start --workspace=backend",
"backend:start:prod": "npm run start:prod --workspace=backend",
"backend:test": "npm run test --workspace=backend",
"backend:test:coverage": "npm run test:cov --workspace=backend",
"backend:test:watch": "npm run test:watch --workspace=backend",
"frontend:build": "npm run build --workspace=frontend",
"frontend:start": "npm run start --workspace=frontend",
Expand Down

0 comments on commit dfb3d08

Please sign in to comment.