Skip to content

Commit

Permalink
refactor ci
Browse files Browse the repository at this point in the history
  • Loading branch information
shrimalmadhur committed Oct 27, 2024
1 parent f2b3ea9 commit b3b1c55
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Check make generate
name: Check go generate
on:
push:
branches:
Expand All @@ -10,7 +10,7 @@ permissions:

jobs:
check-go-generate:
name: Check make generate
name: Check make generate-go
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -20,9 +20,6 @@ jobs:
with:
go-version: '1.21' # Specify the Go version you're using

- name: Set up Rust
uses: dsherret/rust-toolchain-file@v1

- name: Install protoc-gen-go and protoc-gen-go-grpc
run: |
go install google.golang.org/protobuf/cmd/[email protected]
Expand All @@ -41,10 +38,10 @@ jobs:
- name: Run make generate
run: make generate

- name: Check if make generate generated changes that should be committed
- name: Check if make generate-go generated changes that should be committed
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "Error: make generate generated changes that should be committed. Please run 'make generate' and commit the changes."
echo "Error: make generate-go generated changes that should be committed. Please run 'make generate-go' and commit the changes."
git diff
git status
exit 1
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/check-rs-generate
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Check rust generate
on:
push:
branches:
- master
pull_request:

permissions:
contents: read

jobs:
check-go-generate:
name: Check make generate-rs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Rust
uses: dtolnay/[email protected]

- name: Install Protoc
run: |
sudo apt-get update
sudo apt-get install -y protobuf-compiler

- name: Run make generate-rs
run: make generate-rs

- name: Check if make generate-rs generated changes that should be committed
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "Error: make generate-rs generated changes that should be committed. Please run 'make generate-rs' and commit the changes."
git diff
git status
exit 1
fi

0 comments on commit b3b1c55

Please sign in to comment.