Skip to content

ci: Add CircleCI config#2346

Merged
mslipper merged 1 commit intoethereum-optimism:developfrom
mslipper:feat/circleci-2
Mar 24, 2022
Merged

ci: Add CircleCI config#2346
mslipper merged 1 commit intoethereum-optimism:developfrom
mslipper:feat/circleci-2

Conversation

@mslipper
Copy link
Collaborator

@mslipper mslipper commented Mar 18, 2022

Updates our static analysis/test tooling to use CircleCI rather than GitHub actions. Also includes changes to make all of our Go projects pass the linter.

This update is specific to the actions we use to run PR checks. It does not replace the GitHub actions that push releases. Once we've merged this PR and observed its behavior, I'll remove the old actions-based checks and update branch protection rules to require the CircleCI checks.

Why CircleCI?

CircleCI offers the following benefits over actions:

  1. Better reliability.
  2. A choice of executor sizes, which makes our builds faster.
  3. Docker layer caching, which reduces spin-up time for the integration tests by ~50%.
  4. Test parallelism, which reduce the time it takes for our integration tests to run by 30%.

Overall, build time is reduced from 18m to ~12. There's also room for us to reduce build time even further.

How CircleCI Works

This PR introduces a single CircleCI workflow, called main, that builds all projects in the monorepo, performs linting, runs unit tests, and runs integration tests. Whenever possible, it uses CircleCI's native test management functionality to parallelize test runs. Jobs are run in parallel, unless they depend on something else. The dependency graph looks like this:

Screen Shot 2022-03-21 at 12 43 44 PM

Jobs are parameterized whenever in order to support multiple sub-projects with one job config. All the Go projects except l2geth, for example, use go-lint-test to run linting and testing.

Circle is running against this pull request, so you can click on any of the jobs to view their details.

@changeset-bot
Copy link

changeset-bot bot commented Mar 18, 2022

⚠️ No Changeset found

Latest commit: 8d5ebf2

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@codecov-commenter
Copy link

codecov-commenter commented Mar 18, 2022

Codecov Report

Merging #2346 (cf220e2) into develop (06d821b) will not change coverage.
The diff coverage is n/a.

❗ Current head cf220e2 differs from pull request most recent head d128039. Consider uploading reports for the commit d128039 to get more accurate results

@@           Coverage Diff            @@
##           develop    #2346   +/-   ##
========================================
  Coverage    80.14%   80.14%           
========================================
  Files           77       77           
  Lines         2458     2458           
  Branches       450      450           
========================================
  Hits          1970     1970           
  Misses         488      488           
Flag Coverage Δ
contracts 99.29% <ø> (ø)
core-utils 86.77% <ø> (ø)
data-transport-layer 49.72% <ø> (ø)
sdk 55.90% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 06d821b...d128039. Read the comment docs.

@mslipper mslipper marked this pull request as draft March 18, 2022 22:59
key: v1-yarn-install-{{ checksum "yarn.lock" }}
paths:
- node_modules
- packages/common-ts/node_modules
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'll be nice if we could glob these. Unfortunately CircleCI doesn't support path globs

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah 😭

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm this might be a good opportunity to start a "what you need to keep in mind when you add a new package to the monorepo" doc. I've had lots of annoying CI issues whenever I add or delete packages from the monorepo because of stuff like this that needs to be manually updated.

@mslipper mslipper force-pushed the feat/circleci-2 branch 2 times, most recently from 5cae1f0 to cf220e2 Compare March 21, 2022 18:42
@mslipper mslipper marked this pull request as ready for review March 21, 2022 18:54
key: v1-yarn-install-{{ checksum "yarn.lock" }}
paths:
- node_modules
- packages/common-ts/node_modules
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm this might be a good opportunity to start a "what you need to keep in mind when you add a new package to the monorepo" doc. I've had lots of annoying CI issues whenever I add or delete packages from the monorepo because of stuff like this that needs to be manually updated.

Copy link
Contributor

@Inphi Inphi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Good comment summarizing CircleCI.

@mslipper mslipper force-pushed the feat/circleci-2 branch 2 times, most recently from b8e003d to c53ce1d Compare March 23, 2022 17:42
@@ -1,3 +1,7 @@
module.exports = {
extends: '../../.eslintrc.js',
ignorePatterns: [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good way to fix this, looks like it just needs linting fixes

@tynes
Copy link
Contributor

tynes commented Mar 23, 2022

This looks good to me pending small linting fixes

Copy link
Contributor

@smartcontracts smartcontracts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, nice work (as always)

@mslipper mslipper merged commit 1f618bb into ethereum-optimism:develop Mar 24, 2022
theochap pushed a commit that referenced this pull request Dec 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ops Area: ops

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants