-
Notifications
You must be signed in to change notification settings - Fork 115
131 lines (129 loc) · 4.04 KB
/
proto.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
name: Protobuf
on: # yamllint disable-line rule:truthy
pull_request:
paths:
# Keep in sync with below
# The protos themselves
- '**.proto'
# Any generated code
- '**.pb.go'
- '**.pb.gw.go'
- 'indexer/packages/v4-protos/**'
# Code that affects generation
- 'v4-proto-py/**'
- 'v4-proto-js/**'
- 'proto/**'
- 'indexer/package.json'
- 'protocol/scripts/protoc**'
push:
branches:
- main
- 'release/protocol/v[0-9]+.[0-9]+.x' # e.g. release/protocol/v0.1.x
- 'release/protocol/v[0-9]+.x' # e.g. release/protocol/v1.x
paths:
# Keep in sync with above
# The protos themselves
- '**.proto'
# Any generated code
- '**.pb.go'
- '**.pb.gw.go'
- 'indexer/packages/v4-protos/**'
# Code that affects generation
- 'v4-proto-py/**'
- 'v4-proto-js/**'
- 'proto/**'
- 'indexer/package.json'
- 'protocol/scripts/protoc**'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
format:
runs-on: ubuntu-latest
container:
image: ghcr.io/cosmos/proto-builder:0.14.0
options: --user root
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- name: format
run: |
git config --global --add safe.directory /__w/v4-chain/v4-chain
find ./ -name "*.proto" -exec clang-format -i {} \;
git diff --exit-code
lint:
runs-on: ubuntu-latest
container:
image: ghcr.io/cosmos/proto-builder:0.14.0
options: --user root
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- name: lint
run: buf lint --error-format=json
check-bc-breaking:
runs-on: ubuntu-latest
container:
image: ghcr.io/cosmos/proto-builder:0.14.0
options: --user root
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
# For push and PR cases, there's a different way to fetch the branch to compare with
- name: check-bc-breaking
run: |
git config --global --add safe.directory /__w/v4-chain/v4-chain
git fetch origin ${{ github.event.pull_request.base.sha || github.event.before }}
buf breaking --against .git#branch=${{ github.event.pull_request.base.sha || github.event.before }}
protocol-gen:
runs-on: ubuntu-latest
container:
image: ghcr.io/cosmos/proto-builder:0.14.0
options: --user root
steps:
- uses: actions/checkout@v3
- run: git config --global --add safe.directory /__w/v4-chain/v4-chain
- run: sh ./protocol/scripts/protocgen.sh && git diff --exit-code
indexer-gen:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- working-directory: ./indexer
run: |
npm install -g [email protected]
pnpm install --loglevel warn --frozen-lockfile
cd packages/v4-protos && npm run build:verify-proto
v4-proto-py-gen:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.11
- run: |
BIN="/usr/local/bin" && \
VERSION="1.26.1" && \
curl -sSL "https://github.com/bufbuild/buf/releases/download/v${VERSION}/buf-Linux-x86_64" -o "${BIN}/buf" && \
chmod +x "${BIN}/buf"
- run: pip install -r ./v4-proto-py/requirements.txt
- run: make v4-proto-py-gen
v4-proto-js-gen:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- run: |
BIN="/usr/local/bin" && \
VERSION="1.26.1" && \
curl -sSL "https://github.com/bufbuild/buf/releases/download/v${VERSION}/buf-Linux-x86_64" -o "${BIN}/buf" && \
chmod +x "${BIN}/buf"
- working-directory: ./v4-proto-js
run: |
npm install
npm run transpile
npm run build