Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure generated code is up-to-date on PRs #692

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/code-gen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Code Generation

on: [pull_request]

jobs:
up_to_date:
name: Ensure Generated Code Up To Date
runs-on: ubuntu-latest
steps:
- name: Checkout .NET Client
uses: actions/checkout@v4

- name: Setup .NET SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
5.0.x
6.0.x

- name: Cache Nuget Packages
uses: actions/cache@v3
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.?sproj') }}
restore-keys: |
${{ runner.os }}-nuget-

- name: Run Code Generator
run: ./build.sh codegen --branch main

- name: Check For Uncommitted Changes
shell: bash -eo pipefail {0}
run: |
output=$(git status --porcelain)
if [ -z "$output" ]; then
echo "Clean working directory"
exit 0
else
echo "Dirty working directory"
echo "$output"
exit 1
fi
Loading