From ba11f0fef8e03c31246b125cfe376ca6e38209b9 Mon Sep 17 00:00:00 2001 From: Lucas Bertrand Date: Tue, 16 Jul 2024 16:55:48 +0200 Subject: [PATCH] ci: update codecov to use Foundry (#231) --- .github/workflows/coverage.yaml | 8 ++++++-- .gitignore | 1 + foundry.toml | 2 +- package.json | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index 65b4dfda..e58a721b 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -27,13 +27,17 @@ jobs: node-version: "18" registry-url: "https://registry.npmjs.org" + - name: Install Foundry + uses: foundry-rs/foundry-toolchain@v1 + - name: Install Dependencies run: yarn install - name: Test with coverage - run: yarn coverage || true - + run: yarn coverage + - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v4.0.1 with: token: ${{ secrets.CODECOV_TOKEN }} + files: lcov.info diff --git a/.gitignore b/.gitignore index 23576439..ddb1d374 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,7 @@ tsconfig.tsbuildinfo # Coverage coverage coverage.json +lcov.info # Slither scripts/slither-results/* diff --git a/foundry.toml b/foundry.toml index ecfb1b77..49fb663f 100644 --- a/foundry.toml +++ b/foundry.toml @@ -1,5 +1,5 @@ [profile.default] -src = 'contracts' +src = 'contracts/prototypes' out = 'out' libs = ['node_modules', 'lib'] test = 'testFoundry' diff --git a/package.json b/package.json index 56b05443..d0219e87 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,7 @@ "scripts": { "build": "yarn compile && npx del-cli dist abi && npx tsc || true && npx del-cli './dist/typechain-types/**/*.js' && npx cpx './data/**/*' dist/data && npx cpx './artifacts/contracts/**/*' ./abi && npx del-cli './abi/**/*.dbg.json'", "compile": "npx hardhat compile --force", - "coverage": "npx hardhat coverage --temp ./coverage-artifacts", + "coverage": "forge clean && forge coverage --report lcov", "docs": "forge doc", "generate": "yarn compile && ./scripts/generate_go.sh || true && ./scripts/generate_addresses.sh && yarn lint:fix", "lint": "npx eslint . --ext .js,.ts --ignore-pattern lib/",