-
Notifications
You must be signed in to change notification settings - Fork 191
46 lines (39 loc) · 1.2 KB
/
code-generation.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Code Generation
on:
pull_request:
schedule:
- cron: '0 0 * * 1' # 00:00 UTC Weekly on Mondays
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: Download Latest Spec
# if: github.event_name == 'schedule'
run: ./gradlew :java-codegen:downloadLatestSpec
- name: Run Code Generator
run: ./gradlew :java-codegen:run
- name: Git Status
id: git_status
shell: bash -eo pipefail {0}
run: |
output=$(git status --porcelain)
if [ -z "$output" ]; then
echo "Clean working directory"
echo "clean=true" >> $GITHUB_OUTPUT
else
echo "Dirty working directory"
echo "$output"
echo "clean=false" >> $GITHUB_OUTPUT
fi
- name: Fail On Uncommitted Changes
if: github.event_name != 'schedule' && steps.git_status.outputs.clean != 'true'
run: exit 1