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

chore: CircleCI config for main workflow [1/N] #317

Merged
merged 27 commits into from
Jan 15, 2025
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
e45d337
chore: Stub of CircleCI config for main workflow
janjakubnanista Jan 13, 2025
aa75e6c
chore: Rename config.yaml to config.yml
janjakubnanista Jan 13, 2025
9d0081a
fix: Add go/default executor tag
janjakubnanista Jan 13, 2025
bab349f
fix: Run apt install as sudo
janjakubnanista Jan 13, 2025
6c702ea
fix: Go orb versions
janjakubnanista Jan 13, 2025
9f971aa
fix: Step names
janjakubnanista Jan 13, 2025
19c75f1
fix: Go version
janjakubnanista Jan 13, 2025
057b2e2
fix: Switch to curl-based install for just
janjakubnanista Jan 13, 2025
c670e28
fix: Update golangci-lint
janjakubnanista Jan 13, 2025
8e2c2a3
fix: Path to foundryup
janjakubnanista Jan 13, 2025
73831ff
fix: Checkout submodules
janjakubnanista Jan 13, 2025
f56e5c3
fix: Checkout submodules recursively
janjakubnanista Jan 13, 2025
4626a66
chore: Setting up the environment
janjakubnanista Jan 13, 2025
cadca08
fix: Setup PATH
janjakubnanista Jan 13, 2025
9a675c6
fix: Damn you bash quotes
janjakubnanista Jan 13, 2025
4fdf695
fix: Damn you CircleCI $BASH_ENV
janjakubnanista Jan 13, 2025
aad3bff
chore: Prettify
janjakubnanista Jan 13, 2025
d6580b1
chore: Step names
janjakubnanista Jan 13, 2025
1a6b737
chore: Use prebuilt image with just
janjakubnanista Jan 14, 2025
b508bb9
chore: Use prebuilt image with just
janjakubnanista Jan 14, 2025
a0e2333
fix: Restore go orb
janjakubnanista Jan 14, 2025
4f7a7b2
chore: Drop utils orb
janjakubnanista Jan 14, 2025
e7aa07f
chore: DRY
janjakubnanista Jan 14, 2025
deed5e9
chore: Add version parameter to golangci-lint install command
janjakubnanista Jan 14, 2025
d196597
chore: Make sure the go tests don't timeout
janjakubnanista Jan 14, 2025
404a077
chore: Add RPC URLs
janjakubnanista Jan 14, 2025
91ce0e8
fix: Install foundry
janjakubnanista Jan 14, 2025
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
118 changes: 118 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
version: 2.1

executors:
default:
docker:
- image: us-docker.pkg.dev/oplabs-tools-artifacts/images/ci-builder:v0.35.0

orbs:
go: circleci/[email protected]

commands:
# By default, CircleCI does not checkout any submodules
#
# In our case, we need to checkout the submodules recursively
# (since e.g. optimism has its own submodules)
checkout-with-submodules:
steps:
- checkout
- run:
name: Sync submodules
command: git submodule sync
- run:
name: Initialize submodules
command: git submodule update --init --recursive

install-foundry:
steps:
# Since CircleCI only sources the $BASH_ENV before each step, we isolate our $PATH modification to a separate step
- run:
name: Setup $PATH for foundry
command: echo 'export PATH=$HOME/.foundry/bin:$PATH' >> $BASH_ENV
- run:
name: Install Foundry
command: |
curl -L https://foundry.paradigm.xyz | bash
foundryup
- run:
name: Output foundry versions
command: |
anvil --version
forge --version

install-golangci-lint:
parameters:
version:
type: string
default: v1.63.4
steps:
- run:
name: Setup golangci-lint
command: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin << parameters.version >>

install-go-modules:
steps:
- go/load-mod-cache # Load cached Go modules.
- go/mod-download # Run 'go mod download'.
- go/save-mod-cache # Save Go modules to cache.

jobs:
check-versions-monorepo:
executor: default
steps:
- checkout-with-submodules
- run:
name: Check versions
command: just check-monorepo-versions

contracts-tests:
executor: default
environment:
FOUNDRY_PROFILE: ci
steps:
- checkout-with-submodules
- install-foundry
- run:
name: Run Forge build
command: just build-contracts
- run:
name: Run Forge tests
command: just test-contracts

go-lint:
executor: default
steps:
- checkout-with-submodules
- install-go-modules
- install-golangci-lint
- run:
name: Run linter
command: just lint-go

go-tests:
executor: default
steps:
- checkout-with-submodules
- install-foundry
- install-go-modules
- run:
# We need to "rename" some of the variables coming from the CircleCI context
# to match what supersim expects
name: Setup environment variables
command: |
echo "export SUPERSIM_RPC_URL_OP=$RPC_URL_OP_MAINNET" >> $BASH_ENV
echo "export SUPERSIM_RPC_URL_BASE=$RPC_URL_BASE_MAINNET" >> $BASH_ENV
- run:
name: Run tests
command: just test-go
no_output_timeout: 20m

workflows:
main:
jobs:
- check-versions-monorepo
- contracts-tests
- go-lint
- go-tests:
context:
- oplabs-rpc-urls
Loading