From 9d36843665903ad893e06728c93a3eb3da3eea9a Mon Sep 17 00:00:00 2001 From: Gas <86567384+gas1cent@users.noreply.github.com> Date: Thu, 4 Jul 2024 07:16:29 +0400 Subject: [PATCH 1/2] feat: improve coverage action (#73) --- .../workflows/{coverage_check.yml => coverage.yml} | 11 ++++++----- package.json | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) rename .github/workflows/{coverage_check.yml => coverage.yml} (89%) diff --git a/.github/workflows/coverage_check.yml b/.github/workflows/coverage.yml similarity index 89% rename from .github/workflows/coverage_check.yml rename to .github/workflows/coverage.yml index 69ea0b1e..2315a1bd 100644 --- a/.github/workflows/coverage_check.yml +++ b/.github/workflows/coverage.yml @@ -1,4 +1,4 @@ -name: Coverage check on main push +name: Coverage Check on: [push] @@ -7,6 +7,7 @@ env: jobs: upload-coverage: + name: Upload Coverage runs-on: ubuntu-latest steps: @@ -28,7 +29,7 @@ jobs: - name: Run coverage shell: bash - run: forge coverage --report summary --report lcov + run: yarn coverage - name: Setup LCOV uses: hrishikesh-kadam/setup-lcov@v1 @@ -43,7 +44,7 @@ jobs: coverage-files: lcovNew.info - name: Retrieve previous coverage - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: coverage.info continue-on-error: true @@ -66,7 +67,7 @@ jobs: mv lcovNew.info coverage.info - name: Upload the new coverage - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: coverage.info - path: ./coverage.info \ No newline at end of file + path: ./coverage.info diff --git a/package.json b/package.json index 0c743777..246c5dd1 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "scripts": { "build": "forge build", "build:optimized": "FOUNDRY_PROFILE=optimized forge build", - "coverage": "forge coverage --match-contract Unit", + "coverage": "forge coverage --report summary --report lcov --match-path 'test/unit/*'", "deploy:mainnet": "bash -c 'source .env && forge script Deploy -vvvvv --rpc-url $MAINNET_RPC --broadcast --chain mainnet --private-key $MAINNET_DEPLOYER_PK'", "deploy:sepolia": "bash -c 'source .env && forge script Deploy -vvvvv --rpc-url $SEPOLIA_RPC --broadcast --chain sepolia --private-key $SEPOLIA_DEPLOYER_PK'", "lint:check": "yarn lint:sol-tests && yarn lint:sol-logic && forge fmt --check", From 2615e9cf522412cf1d4a3c058765f3e7c5af8932 Mon Sep 17 00:00:00 2001 From: Gas <86567384+gas1cent@users.noreply.github.com> Date: Fri, 5 Jul 2024 18:57:56 +0400 Subject: [PATCH 2/2] feat: gitignore echidna corpus (#72) --- .gitignore | 4 ++++ package.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 9209344d..3c0f973b 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,7 @@ broadcast/*/*/* # Out dir out +crytic-export + +# Echidna corpus +test/invariants/fuzz/echidna_coverage diff --git a/package.json b/package.json index 246c5dd1..0ae14e9c 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "lint:sol-tests": "solhint -c .solhint.tests.json 'test/**/*.sol'", "prepare": "husky install", "test": "forge test -vvv", - "test:fuzz": "echidna test/invariants/fuzz/Greeter.t.sol --contract GreeterInvariant --corpus-dir test/invariants/fuzz/echidna_coverage/ --test-mode assertion", + "test:fuzz": "echidna test/invariants/fuzz/Greeter.t.sol --contract InvariantGreeter --corpus-dir test/invariants/fuzz/echidna_coverage/ --test-mode assertion", "test:integration": "forge test --match-contract Integration -vvv", "test:symbolic": "halmos", "test:unit": "forge test --match-contract Unit -vvv",