summaryrefslogtreecommitdiff
path: root/grpc
diff options
context:
space:
mode:
authormustiikhalil <mustii@mmk.one>2021-02-23 08:51:39 +0300
committerGitHub <noreply@github.com>2021-02-23 08:51:39 +0300
commitffc2ef77caeb6b04e89db952c65216982db44698 (patch)
tree7b9b5772cab1ee003c73ca2c0a23f8c78c8be5cf /grpc
parent1da6f4f18bdc7f47cd84f58a427835f2b790cb29 (diff)
downloadflatbuffers-ffc2ef77caeb6b04e89db952c65216982db44698.tar.gz
flatbuffers-ffc2ef77caeb6b04e89db952c65216982db44698.tar.bz2
flatbuffers-ffc2ef77caeb6b04e89db952c65216982db44698.zip
[CI] Adds Code Generation tests on Github Actions (#6482)
Moves check-grpc-generation to scripts
Diffstat (limited to 'grpc')
-rw-r--r--grpc/examples/generate.sh30
1 files changed, 29 insertions, 1 deletions
diff --git a/grpc/examples/generate.sh b/grpc/examples/generate.sh
index 0d2a900d..0ac2818a 100644
--- a/grpc/examples/generate.sh
+++ b/grpc/examples/generate.sh
@@ -1,3 +1,21 @@
+#!/bin/bash
+#
+# Copyright 2021 Google Inc. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -e
+
current_dir=`pwd`
cd ../..
@@ -6,7 +24,17 @@ main_dir=`pwd`
cd ${current_dir}
-alias fbc='${main_dir}/Debug/flatc'
+# Looks for flatc within the root dir & debug
+if [ -e ${main_dir}/flatc ]; then
+ alias fbc='${main_dir}/flatc'
+elif [ -e ${main_dir}/Debug/flatc ]; then
+ alias fbc='${main_dir}/Debug/flatc'
+else
+ echo 'flatc' could not be found. Make sure to build FlatBuffers from the \
+ $rootdir directory.
+ exit 1
+fi
+
generator="--grpc $current_dir/greeter.fbs"
# Regenerate Go lang code