Skip to content

Commit

Permalink
chore: add actions for lint proto (#277)
Browse files Browse the repository at this point in the history
  • Loading branch information
zakir-code authored Mar 21, 2024
1 parent 62881ec commit 894fbb6
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
25 changes: 25 additions & 0 deletions .github/workflows/proto.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Protobuf

on:
pull_request:
paths:
- "proto/**"

permissions:
contents: read

concurrency:
group: '${{ github.workflow }} @ ${{ github.head_ref || github.ref }}'
cancel-in-progress: true

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run proto format and generate
run: |
docker run --rm --user root --name fx-core-proto-fmt-0.11.2 -v `pwd`:/workspace --workdir /workspace ghcr.io/cosmos/proto-builder:0.11.2 sh ./contrib/protoc/format.sh
docker run --rm --user root --name fx-core-proto-gen-0.11.2 -v `pwd`:/workspace --workdir /workspace tendermintdev/sdk-proto-gen:v0.7 sh ./contrib/protoc/gen.sh
- name: Check diff
run: git diff --exit-code
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ proto-all:

proto-format:
@echo "Formatting Protobuf files"
@if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoFmt}$$"; then docker start -a $(containerProtoFmt); else docker run --rm --name $(containerProtoFmt) -v $(CURDIR):/workspace --workdir /workspace $(protoImageName) \
@if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoFmt}$$"; then docker start -a $(containerProtoFmt); else docker run --name $(containerProtoFmt) -v $(CURDIR):/workspace --workdir /workspace $(protoImageName) \
sh ./contrib/protoc/format.sh; fi

proto-gen:
Expand Down

0 comments on commit 894fbb6

Please sign in to comment.