-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added back grpc codegen and created a workflow for ensuring autogener…
…ated code is as expected
- Loading branch information
Showing
9 changed files
with
175 additions
and
63 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
on: | ||
# Trigger analysis when pushing in master or pull requests, and when creating | ||
# a pull request. | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
|
||
# Declare default permissions as read only. | ||
permissions: read-all | ||
|
||
name: Code Generation Check | ||
jobs: | ||
check-codegen: | ||
strategy: | ||
matrix: | ||
target: [ mocks, protobuf ] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4 | ||
with: | ||
# Disabling shallow clone is recommended for improving relevancy of reporting | ||
fetch-depth: 0 | ||
- uses: jdx/mise-action@0c39a522dfbced3ed83924152c45804a71ce216f # v2.0.4 | ||
with: | ||
experimental: true | ||
- run: mise run clean | ||
- run: mise run generate:${{ matrix.target }} --check |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,5 @@ | |
|
||
rm -rf build | ||
rm -rf dist | ||
rm -rf internal/mocks | ||
find . -name '*.pb.go' -delete |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/sh | ||
# mise sources=[".mockery.yaml", "go.mod", "go.sum", "internal/**/*", "cmd/**/*", "*.go"] | ||
# mise outputs=["build/.mocksentinel"] | ||
|
||
set -e | ||
|
||
mkdir -p build | ||
|
||
check=1 | ||
|
||
handle_argument() { | ||
echo "Argument '$1' not supported" >&2; exit 1 | ||
} | ||
|
||
while test "$#" -gt 0; do | ||
case "$1" in | ||
--check) check=0; shift 1;; | ||
|
||
-*) echo "unknown option: $1" >&2; exit 1;; | ||
*) handle_argument "$1"; shift 1;; | ||
esac | ||
done | ||
|
||
mockery | ||
touch build/.mocksentinel | ||
|
||
if test "$check" = 0; then | ||
echo "\nChecking mocks..." | ||
changes=$(git status --porcelain internal/mocks) | ||
if test -n "$changes"; then | ||
echo "Mocks changed:" | ||
git --no-pager diff internal/mocks | ||
exit 1 | ||
fi | ||
echo "Mocks have no changes according to git!" | ||
fi |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/bin/sh | ||
# mise sources=["proto/**/*.proto"] | ||
# mise outputs=["build/.protobufsentinel"] | ||
|
||
set -e | ||
|
||
mkdir -p build | ||
|
||
check=1 | ||
|
||
handle_argument() { | ||
echo "Argument '$1' not supported" >&2; exit 1 | ||
} | ||
|
||
while test "$#" -gt 0; do | ||
case "$1" in | ||
--check) check=0; shift 1;; | ||
|
||
-*) echo "unknown option: $1" >&2; exit 1;; | ||
*) handle_argument "$1"; shift 1;; | ||
esac | ||
done | ||
|
||
mkdir -p internal/grpc/checks | ||
|
||
protoc \ | ||
--proto_path=proto \ | ||
--go_out=internal/grpc \ | ||
--go_opt=paths=source_relative \ | ||
--go-grpc_out=internal/grpc \ | ||
--go-grpc_opt=paths=source_relative \ | ||
proto/checks/checks.proto | ||
|
||
touch build/.protobufsentinel | ||
|
||
if test "$check" = 0; then | ||
echo "\nChecking GRPC files..." | ||
changes=$(git status --porcelain internal/grpc) | ||
if test -n "$changes"; then | ||
echo "GRPC files changed:" | ||
git --no-pager diff internal/grpc | ||
exit 1 | ||
fi | ||
echo "GRPC files have no changes according to git!" | ||
fi |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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