Skip to content

Commit

Permalink
Add Github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Kogaroshi committed Dec 8, 2021
1 parent d0496d8 commit 7c5e2c4
Show file tree
Hide file tree
Showing 5 changed files with 110 additions and 14 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Coveralls

on: ["push", "pull_request"]

jobs:
coverage:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.4.0]

steps:
- run: git config --global url."https://".insteadOf git://
- run: git config --global url."https://github.com/".insteadOf git@github.com
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm ci
- name: Compile Solidity contracts
run: npm run build
env:
ALCHEMY_API_KEY: ${{ secrets.ALCHEMY_API_KEY }}
CI: true
- run: npm run coverage
env:
ALCHEMY_API_KEY: ${{ secrets.ALCHEMY_API_KEY }}
CI: true
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
37 changes: 37 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Node.js CI

on: ["push", "pull_request"]

jobs:
test:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.4.0]

steps:
- run: git config --global url."https://".insteadOf git://
- run: git config --global url."https://github.com/".insteadOf git@github.com
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm ci
- name: Compile Solidity contracts
run: npm run build
env:
ALCHEMY_API_KEY: ${{ secrets.ALCHEMY_API_KEY }}
CI: true
- run: npm run test
env:
ALCHEMY_API_KEY: ${{ secrets.ALCHEMY_API_KEY }}
CI: true
25 changes: 17 additions & 8 deletions .solcover.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
module.exports = {
skipFiles: [
'utils',
'tokens',
'tests',
'delegators/utils/DelegateRegistry.sol.sol',
'AddressRegistry.sol.sol'
]
};
norpc: true,
testCommand: "npm run test",
compileCommand: "npm run compile",
skipFiles: [
'utils/',
'tokens/',
'tests/',
'delegators/utils/',
'interests/multipliers/utils/',
'./variants/DoomsdayController.sol',
'./AddressRegistry.sol'
],
mocha: {
fgrep: "[skip-on-coverage]",
invert: true,
},
};
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
[![Build & Tests](https://github.com/PaladinFinance/Paladin-Protocol/actions/workflows/main.yml/badge.svg)](https://github.com/PaladinFinance/Paladin-Protocol/actions/workflows/main.yml)
[![Coverage Status](https://coveralls.io/repos/github/PaladinFinance/Paladin-Protocol/badge.svg?branch=main&service=github)](https://coveralls.io/github/PaladinFinance/Paladin-Protocol?branch=main)



# Paladin


Expand Down
16 changes: 10 additions & 6 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ import "hardhat-gas-reporter";
require("dotenv").config();


const TEST_MNEMONIC = "test test test test test test test test test test test junk";
const TEST_ACCOUNT = { mnemonic: TEST_MNEMONIC, }


const config: HardhatUserConfig = {
defaultNetwork: "hardhat",
solidity: {
Expand Down Expand Up @@ -39,22 +43,22 @@ const config: HardhatUserConfig = {
}
},
kovan: {
url: process.env.KOVAN_URI,
accounts: [process.env.KOVAN_PRIVATE_KEY || ''],
url: process.env.KOVAN_URI || '',
accounts: process.env.KOVAN_PRIVATE_KEY ? [process.env.KOVAN_PRIVATE_KEY] : TEST_ACCOUNT,
/*accounts: {
mnemonic: process.env.KOVAN_MNEMONIC,
},*/
},
rinkeby: {
url: process.env.RINKEBY_URI,
accounts: [process.env.RINKEBY_PRIVATE_KEY || ''],
url: process.env.RINKEBY_URI || '',
accounts: process.env.RINKEBY_PRIVATE_KEY ? [process.env.RINKEBY_PRIVATE_KEY] : TEST_ACCOUNT,
/*accounts: {
mnemonic: process.env.RINKEBY_MNEMONIC,
},*/
},
mainnet: {
url: process.env.MAINNET_URI,
accounts: [process.env.MAINNET_PRIVATE_KEY || ''],
url: process.env.MAINNET_URI || '',
accounts: process.env.MAINNET_PRIVATE_KEY ? [process.env.MAINNET_PRIVATE_KEY] : TEST_ACCOUNT,
/*accounts: {
mnemonic: process.env.MAINNET_MNEMONIC,
},*/
Expand Down

0 comments on commit 7c5e2c4

Please sign in to comment.