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

Making CI for testing generated proto correctness #1892

Merged
merged 41 commits into from
Jul 4, 2022
Merged
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
1370357
chain json schema added
xBalbinus Jun 15, 2022
d459d90
sync
xBalbinus Jun 16, 2022
d7aaf99
Merge branch 'main' of https://github.com/osmosis-labs/osmosis
xBalbinus Jun 20, 2022
98a2555
Merge branch 'main' of https://github.com/osmosis-labs/osmosis
xBalbinus Jun 21, 2022
cffb795
Merge branch 'main' of https://github.com/osmosis-labs/osmosis
xBalbinus Jun 28, 2022
c4342d6
added detector for when PR comes not from a fork
xBalbinus Jun 28, 2022
b044e79
fix for conditional run
xBalbinus Jun 28, 2022
be866a4
initialization for proto-correctness CI
xBalbinus Jun 28, 2022
4afc7c2
check-generated proto ci
xBalbinus Jun 28, 2022
79a6494
check-generated proto ci
xBalbinus Jun 28, 2022
ef259dc
Merge branch 'main' of https://github.com/osmosis-labs/osmosis
xBalbinus Jun 28, 2022
91322c2
on fixes
xBalbinus Jun 29, 2022
476a482
CI fixes
xBalbinus Jun 29, 2022
76eb01b
CI fixes
xBalbinus Jun 29, 2022
e07a87b
moving to check-generated, specifying only checks for generated dep f…
xBalbinus Jun 30, 2022
d8dea39
update index
xBalbinus Jun 30, 2022
22c7466
updateindex
xBalbinus Jun 30, 2022
d3954bb
updateindex
xBalbinus Jun 30, 2022
2437a8a
updateindex
xBalbinus Jun 30, 2022
8ca6e0d
check-generated fixes
xBalbinus Jun 30, 2022
c85d1ef
Update .github/workflows/check-generated.yml
xBalbinus Jun 30, 2022
c90af52
Update contrib/scripts/check-generated.sh
xBalbinus Jun 30, 2022
bb44103
Update contrib/scripts/check-generated.sh
xBalbinus Jun 30, 2022
9c05ecf
working protobuf generation fix
xBalbinus Jun 30, 2022
c6e07d1
Merge branch 'xiangan/ci' of https://github.com/osmosis-labs/osmosis …
xBalbinus Jun 30, 2022
d1c7440
Merge branch 'main' into xiangan/ci
xBalbinus Jun 30, 2022
71d30e0
Merge branch 'main' of https://github.com/osmosis-labs/osmosis
xBalbinus Jun 30, 2022
776a977
Merge branch 'main' into xiangan/ci
xBalbinus Jun 30, 2022
944a049
go get instead of go install
xBalbinus Jun 30, 2022
1ba4edc
attempt: check-proto fixes
xBalbinus Jul 1, 2022
cd624cd
attempt: check-proto fixes
xBalbinus Jul 1, 2022
83630c2
working CI check
xBalbinus Jul 1, 2022
dbb92cd
reverting
xBalbinus Jul 1, 2022
a03af67
Remove unnecessary diff
xBalbinus Jul 1, 2022
95962fc
make proto-all
xBalbinus Jul 1, 2022
e959868
working ver. of CI on fork
xBalbinus Jul 1, 2022
d8db568
working ver. of CI on fork
xBalbinus Jul 1, 2022
e7e0f35
removed downloads
xBalbinus Jul 1, 2022
7c9e677
Update check-generated.yml
xBalbinus Jul 2, 2022
15e1069
Update check-generated.yml
xBalbinus Jul 2, 2022
384ba42
Update check-generated.sh
xBalbinus Jul 4, 2022
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
29 changes: 29 additions & 0 deletions .github/workflows/check-generated.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Verify that generated code is up-to-date.
#
# Note that we run these checks regardless whether the input files have
# changed, because generated code can change in response to toolchain updates
# even if no files in the repository are modified.
name: Check generated code
on:
workflow_dispatch:
pull_request:
branches:
- '*'

permissions:
contents: read

jobs:
check-proto:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
with:
go-version: '1.18'

- uses: actions/checkout@v3
with:
fetch-depth: 1 # we need a .git directory to run git diff

- name: "Check protobuf generated code"
run: contrib/scripts/check-generated.sh
2 changes: 1 addition & 1 deletion chain.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
"linux/arm64": "https://github.com/osmosis-labs/osmosis/releases/download/v10.0.0/osmosis-10.0.0-linux-arm64"
}
}
}
}
18 changes: 18 additions & 0 deletions contrib/scripts/check-generated.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash

set -euo pipefail
xBalbinus marked this conversation as resolved.
Show resolved Hide resolved
# Install buf and gogo tools, so that differences that arise from
# toolchain differences are also caught.
readonly tools="$(mktemp -d)"

make proto-gen

#Specificially ignore all differences in go.mod / go.sum.
if ! git diff --stat --exit-code . ':(exclude)*.mod' ':(exclude)*.sum'; then
echo ">> ERROR:"
echo ">>"
echo ">> Protobuf generated code requires update (either tools or .proto files may have changed)."
echo ">> Ensure your tools are up-to-date, re-run 'make proto-all' and update this PR."
echo ">>"
exit 1
fi