Skip to content

Commit

Permalink
Add workflow to ensure generated code is up to date (#1061)
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Farr <tsfarr@amazon.com>
(cherry picked from commit e77e7a8)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] committed Jul 1, 2024
1 parent 1d939a2 commit 0617f43
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/code-generation.yml
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

0 comments on commit 0617f43

Please sign in to comment.