Skip to content
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
3 changes: 3 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ jobs:
- name: Set up environment
uses: ./.github/actions/setup

- name: Build typechain for linting
run: npx hardhat typechain

- name: Run Solidity and Typescript linters
run: npm run lint

Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: solidity-test-coverage

on:
push:
branches:
- main
workflow_dispatch:

concurrency:
group: solidity-test-coverage-${{ github.ref }}
cancel-in-progress: true

jobs:
coverage:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up environment
uses: ./.github/actions/setup

- name: Generate test coverage
run: npm run coverage

- name: Upload artifact of tests
if: '!cancelled()'
uses: actions/upload-artifact@v4
with:
name: solidity-test-coverage
path: ./coverage/
retention-days: 7
8 changes: 8 additions & 0 deletions .solcover.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ module.exports = {
testCommand: 'npm run test',
compileCommand: 'npm run compile',
configureYulOptimizer: true,
measureStatementCoverage: true,
measureFunctionCoverage: true,
measureBranchCoverage: true,
skipFiles: [
'constants',
'errors',
Expand All @@ -11,4 +14,9 @@ module.exports = {
'utils',
'Token.sol',
],
istanbulFolder: './coverage',
istanbulReporter: [
'html',
'text'
]
};
2 changes: 1 addition & 1 deletion hardhat.node.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const config: HardhatUserConfig = {
},
},
},
viaIR: process.env.COVERAGE_REPORT ? false : true,
viaIR: true,
},
},
],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"clean": "hardhat clean",
"compile:size": "hardhat size-contracts",
"compile": "hardhat compile --config hardhat.node.config.ts",
"coverage": "cross-env COVERAGE_REPORT=true HARDHAT_DEPLOY_FIXTURE=true hardhat coverage --network hardhat --solcoverjs ./.solcover.js --temp artifacts --testfiles './test/**/*.test.ts'",
"coverage": "cross-env SOLIDITY_COVERAGE=true HARDHAT_DEPLOY_FIXTURE=true hardhat coverage --solcoverjs ./.solcover.js --testfiles './test/**/*.test.ts'",
"deploy:base_sepolia_dev": "hardhat deploy --network base_sepolia_dev",
"deploy:base_sepolia_stable_dev_prod": "hardhat deploy --network base_sepolia_stable_dev_prod",
"deploy:base_sepolia_stable_dev_staging": "hardhat deploy --network base_sepolia_stable_dev_staging",
Expand Down
Loading