forked from ethereum-optimism/superchain-registry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.yml
156 lines (149 loc) · 4.11 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
version: 2.1
orbs:
go: circleci/go@1.8.0
slack: circleci/slack@4.10.1
commands:
notify-failures-on-main:
description: "Notify Slack"
parameters:
channel:
type: string
default: C03N11M0BBN
steps:
- slack/notify:
channel: << parameters.channel >>
event: fail
template: basic_fail_1
branch_pattern: main
jobs:
golang-lint:
executor:
name: go/default # is based on cimg/go
tag: '1.21'
steps:
- checkout
- run: golangci-lint run superchain/... validation/... add-chain/...
golang-modules-tidy:
executor:
name: go/default # is based on cimg/go
tag: '1.21'
steps:
- checkout
- run:
name: tidy superchain module
command: go mod tidy
working_directory: superchain
- run:
name: tidy validation module
command: go mod tidy
working_directory: validation
- run:
name: tidy add-chain module
command: go mod tidy
working_directory: add-chain
- run:
name: check git tree is clean
command: git diff --exit-code
golang-test:
shell: /bin/bash -eo pipefail
executor:
name: go/default # is based on cimg/go
tag: '1.21'
steps:
- checkout
- run:
# need foundry to execute 'cast call' within add-chain script
name: Install foundry
command: |
echo "SHELL=$SHELL"
# Set up directory structure
mkdir -p $HOME/.foundry/bin
echo 'export PATH="$HOME/.foundry/bin:$PATH"' >> $BASH_ENV
source $BASH_ENV
# Download foundryup and make it executable
curl -sSL "https://raw.githubusercontent.com/foundry-rs/foundry/master/foundryup/foundryup" -o $HOME/.foundry/bin/foundryup
chmod +x $HOME/.foundry/bin/foundryup
$HOME/.foundry/bin/foundryup
forge --version
- run:
name: run superchain module tests
command: go test ./... -v
working_directory: superchain
- run:
name: run validation module tests
command: go test ./... -v
working_directory: validation
- run:
name: run add-chain module tests
command: go test ./... -v
working_directory: add-chain
- notify-failures-on-main
publish-bot:
environment:
NODE_AUTH_TOKEN: $NPM_TOKEN # Use NPM_TOKEN as the auth token
docker:
- image: cimg/node:18 # Use Node.js 18
steps:
- checkout
- run:
name: Set deployment token
command: npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
- env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- run:
name: Build and publish package on NPM 📦
command: pnpm release
check-codegen:
docker:
- image: cimg/node:18.18.2
steps:
- checkout
- run:
name: Run codegen
command: pnpm codegen
- run:
name: Check for changes
command: git diff --exit-code
check-forge-fmt:
docker:
- image: us-docker.pkg.dev/oplabs-tools-artifacts/images/ci-builder:v0.40.0
steps:
- checkout
- run:
name: check compliance with forge fmt
command: |
forge fmt --check
check-security-configs:
circleci_ip_ranges: true
docker:
- image: us-docker.pkg.dev/oplabs-tools-artifacts/images/ci-builder:v0.40.0
steps:
- checkout
- run:
name: check security configs
command: sh ./scripts/check-security-configs.sh
- notify-failures-on-main
workflows:
hourly:
jobs:
- golang-test:
context:
- slack
- check-security-configs:
context:
- slack
triggers:
- schedule:
cron: "0 * * * *"
filters:
branches:
only:
- main
pr-checks:
jobs:
- golang-lint
- golang-modules-tidy
- golang-test
- check-codegen
- check-forge-fmt
- check-security-configs