Skip to content

Commit

Permalink
chore: Add tsconfig.json, update ci.yml
Browse files Browse the repository at this point in the history
Signed-off-by: Ilja von Hoessle <ilja@perun.network>
  • Loading branch information
iljabvh committed Aug 7, 2024
1 parent 9273e8b commit 3fb5576
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 38 deletions.
32 changes: 20 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,32 @@ jobs:
- name: Install npm
uses: actions/setup-node@v2
with:
node-version: '16'
node-version: '18'

- name: Install dependencies
run: yarn

- name: Lint
run: npx solhint 'contracts/**/*.sol'

- name: Build
run: yarn build
- name: Install Hardhat and other dependencies
run: |
yarn add --dev hardhat
yarn add --dev ts-node
yarn add --dev @nomicfoundation/hardhat-toolbox
yarn add --dev @nomicfoundation/hardhat-chai-matchers@^2.0.0
yarn add --dev @nomicfoundation/hardhat-ethers@^3.0.0
yarn add --dev @nomicfoundation/hardhat-ignition-ethers@^0.15.0
yarn add --dev @nomicfoundation/hardhat-network-helpers@^1.0.0
yarn add --dev @nomicfoundation/hardhat-verify@^2.0.0
yarn add --dev @typechain/ethers-v6@^0.5.0
yarn add --dev @typechain/hardhat@^9.0.0
yarn add --dev hardhat-gas-reporter@^1.0.8
yarn add --dev @nomicfoundation/hardhat-ignition@^0.15.5
yarn add --dev @nomicfoundation/ignition-core@^0.15.5
- name: Compile
run: npx hardhat compile

- name: Static analysis
run: |
Expand All @@ -47,13 +63,5 @@ jobs:
# WORKDIR=/share docker run --rm -v $(pwd):$WORKDIR -w $WORKDIR --entrypoint slither trailofbits/eth-security-toolbox [insert slither parameters here]
- name: Test
run: yarn test
run: npx hardhat test

- name: Test coverage
run: npx truffle run coverage

- name: Upload coverage
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)
29 changes: 20 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
{
"devDependencies": {
"@nomicfoundation/hardhat-ethers": "^3.0.6",
"@nomicfoundation/hardhat-toolbox": "^5.0.0",
"@typechain/ethers-v6": "^0.5.1",
"@typechain/hardhat": "^9.1.0",
"@types/bn.js": "^4.11.4",
"@types/chai": "^4.1.7",
"@types/mocha": "^5.2.5",
"@types/node": "^10.12.19",
"@types/chai": "^4.3.16",
"@types/mocha": "^9.1.1",
"@types/node": "^18.0.0",
"bn.js": "^5.2.1",
"chai": "^4.2.0",
"chai": "^4.4.1",
"ethers": "^6.13.2",
"hardhat": "^2.22.6",
"openzeppelin-solidity": "^2.1.2",
"solhint": "^3.3.2",
"truffle": "5.5.18",
"truffle-assertions": "^0.7.2",
"typechain": "^0.3.11",
"typescript": "^4.2.2",
"web3": "^1.2.6"
"ts-node": "^10.9.2",
"typechain": "^8.3.2",
"typescript": "^4.2.2"
},
"scripts": {
"clean": "rm -rf ./build/",
Expand All @@ -26,7 +32,7 @@
},
"dependencies": {
"eth-gas-reporter": "^0.2.19",
"solidity-coverage": "^0.7.0",
"solidity-coverage": "^0.8.1",
"truffle-error": "^0.0.5",
"truffle-typings": "^1.0.8",
"web3-eth": "^1.2.6",
Expand All @@ -36,5 +42,10 @@
"os": [
"linux",
"darwin"
]
],
"name": "perun-eth-contracts",
"main": "index.js",
"repository": "https://github.com/hyperledger-labs/perun-eth-contracts.git",
"author": "Ilja von Hoessle <ilja@perun.network>",
"license": "MIT"
}
39 changes: 22 additions & 17 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
{
"compilerOptions": {
"target": "es2017",
"target": "es2020",
"module": "commonjs",
"strict": true,
"moduleResolution": "node",
"noImplicitThis": true,
"alwaysStrict": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"lib": ["es2017", "esnext.asynciterable"],
"sourceMap": true,
"rootDir": "src",
"outDir": "build",
"typeRoots": ["./node_modules", "./node_modules/@types", "./types"],
"types": ["node", "chai", "mocha", "bn.js", "web3", "truffle-typings", "truffle-contracts"]
"strict": true,
"skipLibCheck": true,
"resolveJsonModule": true,
"types": [
"node",
"mocha",
"chai"
],
"typeRoots": [
"./node_modules/@types"
]
},
"include": ["src/**/*.ts"],
"exclude": ["node_modules", "build", "node_modules/*"]
}
"include": [
"./test",
"./typechain-types",
"./hardhat.config.ts",
".skipfiles/Lock.skip.ts"
],
"files": [
"./hardhat.config.ts"
]
}

0 comments on commit 3fb5576

Please sign in to comment.