diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5d6114b..e2d09a3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -92,3 +92,28 @@ jobs: run: | echo "## Tests result" >> $GITHUB_STEP_SUMMARY echo "✅ Passed" >> $GITHUB_STEP_SUMMARY + + coverage: + needs: ["lint", "build"] + runs-on: "ubuntu-latest" + steps: + - name: "Check out the repo" + uses: "actions/checkout@v3" + with: + submodules: "recursive" + + - name: "Install Foundry" + uses: "foundry-rs/foundry-toolchain@v1" + + - name: "Generate the coverage report using the unit and the integration tests" + run: 'forge coverage --match-path "test/**/*.sol" --report lcov' + + - name: "Upload coverage report to Codecov" + uses: "codecov/codecov-action@v3" + with: + files: "./lcov.info" + + - name: "Add coverage summary" + run: | + echo "## Coverage result" >> $GITHUB_STEP_SUMMARY + echo "✅ Uploaded to Codecov" >> $GITHUB_STEP_SUMMARY diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..5666091 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,28 @@ +codecov: + require_ci_to_pass: false +comment: false +ignore: + - "script" + - "test" +coverage: + status: + project: + default: + # advanced settings + + # Prevents PR from being blocked with a reduction in coverage. + # Note, if we want to re-enable this, a `threshold` value can be used + # allow coverage to drop by x% while still posting a success status. + # `informational`: https://docs.codecov.com/docs/commit-status#informational + # `threshold`: https://docs.codecov.com/docs/commit-status#threshold + informational: true + patch: + default: + # advanced settings + + # Prevents PR from being blocked with a reduction in coverage. + # Note, if we want to re-enable this, a `threshold` value can be used + # allow coverage to drop by x% while still posting a success status. + # `informational`: https://docs.codecov.com/docs/commit-status#informational + # `threshold`: https://docs.codecov.com/docs/commit-status#threshold + informational: true