-
Notifications
You must be signed in to change notification settings - Fork 146
/
Copy pathconfig.yml
158 lines (148 loc) · 4.46 KB
/
config.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
version: 2.1
orbs:
codecov: codecov/[email protected]
utils: ethereum-optimism/[email protected]
parameters:
default_docker_image:
type: string
default: cimg/base:2024.01
sepolia_rpc_url:
type: string
default: https://ci-sepolia-l1.optimism.io
mainnet_rpc_url:
type: string
default: https://ci-mainnet-l1.optimism.io
github_repo:
type: string
default: ethereum-optimism/superchain-registry
jobs:
go-lint-test:
circleci_ip_ranges: true
parameters:
package:
type: string
docker:
- image: <<pipeline.parameters.default_docker_image>>
steps:
- utils/checkout-with-mise
- run:
name: Tidy mod
command: |
go mod tidy
git diff --exit-code
working_directory: << parameters.package >>
- run:
name: Lint
command: golangci-lint run ./...
working_directory: << parameters.package >>
- run:
name: Run tests
command: gotestsum --format testname --junitfile test-results.xml --packages=./... -- --coverprofile coverage.out
working_directory: << parameters.package >>
environment:
SEPOLIA_RPC_URL: << pipeline.parameters.sepolia_rpc_url >>
MAINNET_RPC_URL: << pipeline.parameters.mainnet_rpc_url >>
- store_test_results:
path: << parameters.package >>/test-results.xml
- codecov/upload:
disable_search: true
files: ./<<parameters.package>>/coverage.out
run-tool:
parameters:
tool:
type: string
args:
type: string
default: ""
check_diff:
type: boolean
default: false
docker:
- image: <<pipeline.parameters.default_docker_image>>
steps:
- utils/checkout-with-mise
- run:
name: Run tool
command: go run ./cmd/<< parameters.tool >>/main.go << parameters.args >>
working_directory: ops
- when:
condition: << parameters.check_diff >>
steps:
- run:
name: Check diff
command: git diff --exit-code
check-staging-empty:
docker:
- image: <<pipeline.parameters.default_docker_image>>
steps:
- utils/checkout-with-mise
- run:
name: Check staging is empty
command: |
# Count number of files in .staging (including hidden files)
file_count=$(ls -la .staging | wc -l)
# Subtract 3 from count to account for "." and ".." and ".gitkeep"
actual_count=$((file_count - 3))
# Check if .gitkeep exists
if [ ! -f ".staging/.gitkeep" ]; then
echo "Error: .gitkeep file is missing"
exit 1
fi
# Nothing else should be in the directory
if [ $actual_count -ne 1 ]; then
echo "Staging directory is not empty"
exit 1
fi
run-staging-report:
circleci_ip_ranges: true
docker:
- image: <<pipeline.parameters.default_docker_image>>
steps:
- utils/checkout-with-mise
- run:
name: Check if PR
command: |
if [ -z "$CIRCLE_PULL_REQUEST" ]; then
echo "Not a PR, skipping"
circleci-agent step halt
fi
- run:
name: Run staging report
environment:
SEPOLIA_RPC_URL: << pipeline.parameters.sepolia_rpc_url >>
MAINNET_RPC_URL: << pipeline.parameters.mainnet_rpc_url >>
GITHUB_REPO: << pipeline.parameters.github_repo >>
command: |
cd ops
go run ./cmd/print_staging_report/main.go
workflows:
main:
jobs:
- go-lint-test:
name: go-lint-test-ops
package: ops
- go-lint-test:
name: go-lint-test-validation
package: validation
- run-tool:
name: check-genesis-integrity
tool: check_genesis_integrity
- run-tool:
name: check-codegen
tool: codegen
check_diff: true
- run-tool:
name: check-staging-synced
tool: sync_staging
check_diff: true
- check-staging-empty:
name: check-staging-empty
- run-tool:
name: check-apply-hardforks
tool: apply_hardforks
check_diff: true
- run-tool:
name: check-chainlist
tool: check_chainlist
- run-staging-report:
name: run-staging-report