Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add action #1

Merged
merged 7 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Build and Test

on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]

jobs:
Setup:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20.9.0"

- name: Cache node modules
uses: actions/cache@v4
id: npm-cache
with:
path: |
node_modules
~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}

- name: Install dependencies
if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm i

Test:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' # This line ensures that this job only runs on pull requests
needs: Setup
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20.9.0"

- name: Cache node modules
uses: actions/cache/restore@v4
with:
path: |
node_modules
~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}

- name: Run tests
run: npx hardhat test

Coverage-Test:
runs-on: ubuntu-latest
needs: Setup
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20.9.0"

- name: Cache node modules
uses: actions/cache/restore@v4
with:
path: |
node_modules
~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}

- name: Run tests and generate coverage
run: npx hardhat coverage

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }} # required
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# CollateralProvider
[![Build and Test](https://github.com/The-Poolz/LockDealNFT.CollateralProvider/actions/workflows/node.js.yml/badge.svg)](https://github.com/The-Poolz/LockDealNFT.CollateralProvider/actions/workflows/node.js.yml)
[![codecov](https://codecov.io/gh/The-Poolz/LockDealNFT.CollateralProvider/branch/master/graph/badge.svg)](https://codecov.io/gh/The-Poolz/LockDealNFT.CollateralProvider)
[![CodeFactor](https://www.codefactor.io/repository/github/the-poolz/LockDealNFT.CollateralProvider/badge)](https://www.codefactor.io/repository/github/the-poolz/LockDealNFT.CollateralProvider)

**CollateralProvider** is a contract that enables the management of `tokens` and `main coins` for the **Project Owner**.

## Pools
Expand Down
Loading