Commit 33889f54 authored by Matthew Slipper's avatar Matthew Slipper Committed by GitHub

ci: Run contract checks and tests on self-hosted infra (#13219)

* ci: Run contract checks and tests on self-hosted infra

* whoops

* submodule update with multiple jobs

* increase jobs

* comment
parent 531e3d9f
...@@ -123,7 +123,11 @@ commands: ...@@ -123,7 +123,11 @@ commands:
description: "Install the dependencies for the smart contracts" description: "Install the dependencies for the smart contracts"
steps: steps:
- run: - 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 working_directory: packages/contracts-bedrock
notify-failures-on-develop: notify-failures-on-develop:
...@@ -623,14 +627,9 @@ jobs: ...@@ -623,14 +627,9 @@ jobs:
flags: contracts-bedrock-tests flags: contracts-bedrock-tests
contracts-bedrock-tests: contracts-bedrock-tests:
docker: machine: true
- image: <<pipeline.parameters.ci_builder_image>> resource_class: ethereum-optimism/latitude-1
resource_class: xlarge
parameters: parameters:
test_parallelism:
description: Number of test jobs to run in parallel
type: integer
default: 4
test_list: test_list:
description: List of test files to run description: List of test files to run
type: string type: string
...@@ -654,7 +653,6 @@ jobs: ...@@ -654,7 +653,6 @@ jobs:
description: Profile to use for testing description: Profile to use for testing
type: string type: string
default: ci default: ci
parallelism: <<parameters.test_parallelism>>
steps: steps:
- checkout - checkout
- attach_workspace: { at: "." } - attach_workspace: { at: "." }
...@@ -670,14 +668,6 @@ jobs: ...@@ -670,14 +668,6 @@ jobs:
working_directory: packages/contracts-bedrock working_directory: packages/contracts-bedrock
- check-changed: - check-changed:
patterns: contracts-bedrock,op-node 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: - run:
name: Print dependencies name: Print dependencies
command: just dep-status command: just dep-status
...@@ -725,17 +715,14 @@ jobs: ...@@ -725,17 +715,14 @@ jobs:
- notify-failures-on-develop - notify-failures-on-develop
contracts-bedrock-checks: contracts-bedrock-checks:
docker: machine: true
- image: <<pipeline.parameters.ci_builder_image>> resource_class: ethereum-optimism/latitude-1
resource_class: xlarge
steps: steps:
- checkout - checkout
- attach_workspace: { at: "." } - attach_workspace: { at: "." }
- install-contracts-dependencies - install-contracts-dependencies
- check-changed: - check-changed:
patterns: contracts-bedrock,op-node patterns: contracts-bedrock,op-node
- setup_remote_docker:
docker_layer_caching: true
- run: - run:
name: print forge version name: print forge version
command: forge --version command: forge --version
...@@ -1320,17 +1307,14 @@ workflows: ...@@ -1320,17 +1307,14 @@ workflows:
- contracts-bedrock-tests: - contracts-bedrock-tests:
# Test everything except PreimageOracle.t.sol since it's slow. # Test everything except PreimageOracle.t.sol since it's slow.
name: contracts-bedrock-tests name: contracts-bedrock-tests
test_parallelism: 4
test_list: find test -name "*.t.sol" -not -name "PreimageOracle.t.sol" test_list: find test -name "*.t.sol" -not -name "PreimageOracle.t.sol"
- contracts-bedrock-tests: - contracts-bedrock-tests:
# PreimageOracle test is slow, run it separately to unblock CI. # PreimageOracle test is slow, run it separately to unblock CI.
name: contracts-bedrock-tests-preimage-oracle name: contracts-bedrock-tests-preimage-oracle
test_parallelism: 1
test_list: find test -name "PreimageOracle.t.sol" test_list: find test -name "PreimageOracle.t.sol"
- contracts-bedrock-tests: - contracts-bedrock-tests:
# Heavily fuzz any fuzz tests within added or modified test files. # Heavily fuzz any fuzz tests within added or modified test files.
name: contracts-bedrock-tests-heavy-fuzz-modified 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_list: git diff origin/develop...HEAD --name-only --diff-filter=AM -- './test/**/*.t.sol' | sed 's|packages/contracts-bedrock/||'
test_timeout: 1h test_timeout: 1h
test_profile: ciheavy test_profile: ciheavy
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment