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

Coveralls #1

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
30 changes: 30 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
version: 2.1

jobs:
coverage:
docker:
- image: circleci/node:12
steps:
- checkout
- run:
name: Delete any old node_modules
command: |
rm -rf node_modules/
- run:
name: Install dependencies
command: |
npm install
- run:
name: Run tests
command: |
npx hardhat coverage
- run:
name: Upload coverage
command: |
cat coverage/lcov.info | node_modules/.bin/coveralls

workflows:
version: 2
build:
jobs:
- coverage
1 change: 1 addition & 0 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
repo_token: UrIrxLf8mmZBKkFR0MGcxnCav9Io9XVMV
39 changes: 39 additions & 0 deletions contracts/V8.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
pragma solidity ^0.5.0;

// A contract for show-casing new coverage measurements
// in solidity-coverage 0.8.x
contract V8 {
uint a;

modifier checkInput(uint x){
require(x != 0, 'x cannot be zero');
_;
}

function set(uint x)
public
checkInput(x)
{
a = x;
}

function setOR(uint x)
public
{
if (
x == 1 ||
x == 2 ||
x == 3
){
a = x;
}
}

function setTernary(uint x)
public
{
(x == 1)
? a = x
: a = 5;
}
}
Loading