core: remove trailing slash in prefixes #3520
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Protobuf | |
on: | |
# Exclude feature branches, only run if the PR is targeting main. | |
pull_request_target: | |
types: | |
- opened | |
branches: | |
- "main" | |
jobs: | |
lint: | |
name: Lint protobuf | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: bufbuild/buf-setup-action@v1 | |
with: | |
buf_api_token: ${{ secrets.BUF_TOKEN }} | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
# input: 'proto' | |
- uses: bufbuild/buf-lint-action@v1 | |
with: | |
input: 'proto' | |
buf_token: ${{ secrets.BUF_TOKEN }} | |
- name: Check for module path changes | |
shell: bash | |
run: | | |
cd proto/penumbra | |
buf mod update | |
s="$(git status --porcelain)" | |
if [[ -n "$s" ]]; then | |
echo "ERROR: run 'buf mod update' to synchronize buf.lock" | |
echo "$s" | |
exit 1 | |
else | |
echo "OK: no changes required to buf.lock" | |
fi | |
- name: Check for breaking changes | |
uses: bufbuild/buf-breaking-action@v1 | |
with: | |
input: 'proto' | |
# The 'main' branch of the GitHub repository that defines the module. | |
against: 'https://github.com/${GITHUB_REPOSITORY}.git#branch=main,subdir=proto' | |
protobuf-fresh: | |
name: Compile protobuf specs to rust code | |
runs-on: buildjet-16vcpu-ubuntu-2004 | |
# runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the source code | |
uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- name: Install Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: false | |
- uses: bufbuild/buf-setup-action@v1 | |
with: | |
buf_api_token: ${{ secrets.BUF_TOKEN }} | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
# input: 'proto' | |
- name: Install protobuf compiler | |
shell: bash | |
run: | | |
cd /tmp | |
curl -sSfL -O https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-x86_64.zip | |
unzip protoc-${PROTOC_VERSION}-linux-x86_64.zip -d $HOME/.local | |
env: | |
PROTOC_VERSION: "24.4" | |
# We exclude the proto_descriptor file from diff inspection, since | |
# different versions of `protoc` can generate non-substantive changes, | |
# causing noisy CI failures. | |
- name: Compile protobuf specs into rust src files | |
shell: bash | |
run: | | |
./deployments/scripts/protobuf-codegen | |
# https://github.com/penumbra-zone/penumbra/issues/3038#issuecomment-1722534133 | |
git checkout crates/proto/src/gen/proto_descriptor.bin.no_lfs | |
git checkout crates/storage/src/gen/proto_descriptor.bin.no_lfs | |
s="$(git status --porcelain)" | |
if [[ -n "$s" ]]; then | |
echo "ERROR: protobuf files must be regenerated and committed." | |
echo "Run this command locally: ./deployments/scripts/protobuf-codegen" | |
echo "These are the files that reported differences:" | |
echo "$s" | |
exit 1 | |
else | |
echo "OK: no changes required to protobuf specs" | |
fi |