Skip to content

Commit

Permalink
add codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0neerpat committed Jul 25, 2024
1 parent f309979 commit ef298df
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 1 deletion.
52 changes: 52 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Coverage

on: [push]

concurrency:
group: ${{github.workflow}}-${{github.ref}}
cancel-in-progress: true

env:
FOUNDRY_PROFILE: ci
ARB_SEPOLIA_RPC: ${{ secrets.ARB_SEPOLIA_RPC }}
ARB_MAINNET_RPC: ${{ secrets.ARB_MAINNET_RPC }}

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

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: "yarn"

- name: Install dependencies
run: yarn --frozen-lockfile --network-concurrency 1

- name: Install forge dependencies
run: forge install

- name: Precompile using 0.8.19 and via-ir=false
run: yarn build

- name: Install lcov (coverage dependency)
run: sudo apt-get update && sudo apt-get install lcov -y

- name: Run Coverage
shell: bash
run: yarn test:coverage

- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
slug: ${{ github.repository }}
5 changes: 4 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ on: [push]
concurrency:
group: ${{ github.workflow}}-${{github.ref}}
cancel-in-progress: true

env:
FOUNDRY_PROFILE: ci
ARB_SEPOLIA_RPC: ${{ secrets.ARB_SEPOLIA_RPC }}
ARB_MAINNET_RPC: ${{ secrets.ARB_MAINNET_RPC }}
jobs:
lint:
name: Run Linters
Expand Down
34 changes: 34 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
codecov:
require_ci_to_pass: yes

coverage:
status:
project:
default:
target: auto
threshold: 95
base: auto
precision: 2
round: down
range: "95...100"

parsers:
gcov:
branch_detection:
conditional: yes
loop: yes
method: no
macro: no

comment:
layout: "reach, diff, flags, files"
behavior: default
require_changes: false
require_base: no
require_head: yes

ignore:
- "test"
- "script"
- "src/libraries/"
- "src/contracts/for-test/"

0 comments on commit ef298df

Please sign in to comment.