Skip to content

Commit

Permalink
ci: Run contract checks and tests on self-hosted infra (#13219)
Browse files Browse the repository at this point in the history
* ci: Run contract checks and tests on self-hosted infra

* whoops

* submodule update with multiple jobs

* increase jobs

* comment
  • Loading branch information
mslipper authored and sigma committed Dec 19, 2024
1 parent 513e033 commit e9100fa
Showing 1 changed file with 9 additions and 25 deletions.
34 changes: 9 additions & 25 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,11 @@ commands:
description: "Install the dependencies for the smart contracts"
steps:
- run:
command: just install
name: Install dependencies
command: |
# Manually craft the submodule update command in order to take advantage
# of the -j parameter, which speeds it up a lot.
git submodule update --init --recursive --force -j 8
working_directory: packages/contracts-bedrock

notify-failures-on-develop:
Expand Down Expand Up @@ -623,14 +627,9 @@ jobs:
flags: contracts-bedrock-tests

contracts-bedrock-tests:
docker:
- image: <<pipeline.parameters.ci_builder_image>>
resource_class: xlarge
machine: true
resource_class: ethereum-optimism/latitude-1
parameters:
test_parallelism:
description: Number of test jobs to run in parallel
type: integer
default: 4
test_list:
description: List of test files to run
type: string
Expand All @@ -654,7 +653,6 @@ jobs:
description: Profile to use for testing
type: string
default: ci
parallelism: <<parameters.test_parallelism>>
steps:
- checkout
- attach_workspace: { at: "." }
Expand All @@ -670,14 +668,6 @@ jobs:
working_directory: packages/contracts-bedrock
- check-changed:
patterns: contracts-bedrock,op-node
- restore_cache:
name: Restore Go modules cache
key: gomod-{{ checksum "go.sum" }}
- restore_cache:
name: Restore Go build cache
keys:
- golang-build-cache-contracts-bedrock-tests-{{ checksum "go.sum" }}
- golang-build-cache-contracts-bedrock-tests-
- run:
name: Print dependencies
command: just dep-status
Expand Down Expand Up @@ -725,17 +715,14 @@ jobs:
- notify-failures-on-develop

contracts-bedrock-checks:
docker:
- image: <<pipeline.parameters.ci_builder_image>>
resource_class: xlarge
machine: true
resource_class: ethereum-optimism/latitude-1
steps:
- checkout
- attach_workspace: { at: "." }
- install-contracts-dependencies
- check-changed:
patterns: contracts-bedrock,op-node
- setup_remote_docker:
docker_layer_caching: true
- run:
name: print forge version
command: forge --version
Expand Down Expand Up @@ -1320,17 +1307,14 @@ workflows:
- contracts-bedrock-tests:
# Test everything except PreimageOracle.t.sol since it's slow.
name: contracts-bedrock-tests
test_parallelism: 4
test_list: find test -name "*.t.sol" -not -name "PreimageOracle.t.sol"
- contracts-bedrock-tests:
# PreimageOracle test is slow, run it separately to unblock CI.
name: contracts-bedrock-tests-preimage-oracle
test_parallelism: 1
test_list: find test -name "PreimageOracle.t.sol"
- contracts-bedrock-tests:
# Heavily fuzz any fuzz tests within added or modified test files.
name: contracts-bedrock-tests-heavy-fuzz-modified
test_parallelism: 1
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
Expand Down

0 comments on commit e9100fa

Please sign in to comment.