-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add workflow to ensure generated code is up to date (#1061)
Signed-off-by: Thomas Farr <[email protected]>
- Loading branch information
Showing
1 changed file
with
34 additions
and
0 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,34 @@ | ||
name: Code Generation | ||
|
||
on: [pull_request] | ||
|
||
jobs: | ||
up_to_date: | ||
name: Ensure Generated Code Up To Date | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Java Client | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up JDK | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: 11 | ||
distribution: 'temurin' | ||
cache: 'gradle' | ||
|
||
- name: Run Code Generator | ||
run: ./gradlew clean :java-codegen:run | ||
|
||
- name: Check Has No 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 |