Skip to content

Test Suite | Node Start #114

Test Suite | Node Start

Test Suite | Node Start #114

name: Verify Schema Generation
on:
pull_request:
branches: v3
jobs:
verify-schema-generation:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
fetch-depth: 0 # Ensure the full history is fetched for proper diffing
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.23' # Specify your Go version
- name: Install Protoc
run: |
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v28.3/protoc-28.3-linux-x86_64.zip
sudo unzip protoc-28.3-linux-x86_64.zip -d /usr/local
rm protoc-28.3-linux-x86_64.zip
- name: Install dependencies
run: |
go install github.com/go-task/task/v3/cmd/task@latest
go install github.com/atombender/go-jsonschema@latest
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
- name: Run 'task gen-schema'
run: |
task all-code-gen
- name: Check for Uncommitted Changes
run: |
git config --global --add safe.directory /github/workspace
if [[ $(git status --porcelain) ]]; then
echo "Uncommitted changes detected after running 'task gen-schema'."
echo "Please run 'task gen-schema' and commit the changes."
git diff
exit 1
else
echo "No changes detected. Generated code is up to date."
fi