Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run forge coverage periodically #13222

Merged
merged 7 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 31 additions & 13 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ parameters:
stale_check_dispatch:
type: boolean
default: false
contracts_coverage_dispatch:
type: boolean
default: false

orbs:
go: circleci/[email protected]
Expand Down Expand Up @@ -287,10 +290,14 @@ jobs:
machine: true
resource_class: ethereum-optimism/latitude-1
parameters:
skip_pattern:
description: Glob pattern of tests to skip
build_args:
description: Forge build arguments
type: string
default: ""
profile:
description: Profile to use for building
type: string
default: ci
steps:
- checkout
- install-contracts-dependencies
Expand All @@ -303,9 +310,9 @@ jobs:
working_directory: packages/contracts-bedrock
- run:
name: Build contracts
command: forge build --deny-warnings --skip <<parameters.skip_pattern>>
command: forge build <<parameters.build_args>>
environment:
FOUNDRY_PROFILE: ci
FOUNDRY_PROFILE: <<parameters.profile>>
working_directory: packages/contracts-bedrock
- run:
name: Generate allocs
Expand Down Expand Up @@ -605,11 +612,11 @@ jobs:
command: just coverage-lcov
no_output_timeout: 18m
environment:
FOUNDRY_PROFILE: ci
FOUNDRY_PROFILE: cicoverage
working_directory: packages/contracts-bedrock
- codecov/upload:
disable_search: true
files: ./packages/contracts-bedrock/coverage/lcov.info
files: ./packages/contracts-bedrock/lcov.info
flags: contracts-bedrock-tests

contracts-bedrock-tests:
Expand Down Expand Up @@ -1298,8 +1305,12 @@ workflows:
jobs:
- go-mod-download
- contracts-bedrock-build:
name: contracts-bedrock-build
# Build with just core + script contracts.
skip_pattern: test
build_args: --deny-warnings --skip test
- contracts-bedrock-build:
name: contracts-bedrock-build-coverage
profile: cicoverage
- check-kontrol-build:
requires:
- contracts-bedrock-build
Expand All @@ -1320,10 +1331,6 @@ workflows:
test_list: git diff origin/develop...HEAD --name-only --diff-filter=AM -- './test/**/*.t.sol' | sed 's|packages/contracts-bedrock/||'
test_timeout: 1h
test_profile: ciheavy
- contracts-bedrock-coverage:
filters:
branches:
ignore: /.*/
- contracts-bedrock-checks:
requires:
- contracts-bedrock-build
Expand Down Expand Up @@ -1596,7 +1603,7 @@ workflows:
context:
- slack
- contracts-bedrock-build:
skip_pattern: test
build_args: --deny-warnings --skip test
context:
- slack
- go-tests:
Expand Down Expand Up @@ -1634,7 +1641,7 @@ workflows:
- equal: [true, << pipeline.parameters.cannon_full_test_dispatch >>]
jobs:
- contracts-bedrock-build:
skip_pattern: test
build_args: --deny-warnings --skip test
- cannon-go-lint-and-test:
name: cannon-go-lint-and-test-<<matrix.mips_word_size>>-bit
requires:
Expand All @@ -1645,6 +1652,17 @@ workflows:
parameters:
mips_word_size: [32, 64]

scheduled-forge-coverage:
when:
or:
- equal: [build_four_hours, <<pipeline.schedule.name>>]
- equal: [true, << pipeline.parameters.contracts_coverage_dispatch >>]
jobs:
- contracts-bedrock-build:
name: contracts-bedrock-build-coverage
profile: cicoverage
- contracts-bedrock-coverage

scheduled-docker-publish:
when:
or:
Expand Down
14 changes: 14 additions & 0 deletions packages/contracts-bedrock/foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,20 @@ runs = 512
runs = 256
depth = 32

################################################################
# PROFILE: CICOVERAGE #
################################################################

[profile.cicoverage]
optimizer = false

[profile.cicoverage.fuzz]
runs = 512

[profile.cicoverage.invariant]
runs = 256
depth = 32

################################################################
# PROFILE: CIHEAVY #
################################################################
Expand Down