Skip to content

Commit 8c426e5

Browse files
committed
add: configure CI/CD workflows for build and formatting checks
Signed-off-by: Zach Harel <zach@zharel.me>
1 parent d2156d5 commit 8c426e5

4 files changed

Lines changed: 88 additions & 1 deletion

File tree

.github/workflows/build.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: Set up JDK
18+
uses: actions/setup-java@v4
19+
with:
20+
java-version: '17'
21+
distribution: 'temurin'
22+
23+
- name: Setup Gradle
24+
uses: gradle/actions/setup-gradle@v4
25+
26+
- name: Grant execute permission for gradlew
27+
run: chmod +x gradlew
28+
29+
- name: Build with Gradle
30+
run: ./gradlew build
31+
32+
- name: Run tests
33+
run: ./gradlew test
34+
35+

.github/workflows/spotless.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Spotless Check
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
spotless:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: Set up JDK
18+
uses: actions/setup-java@v4
19+
with:
20+
java-version: '17'
21+
distribution: 'temurin'
22+
23+
- name: Setup Gradle
24+
uses: gradle/actions/setup-gradle@v4
25+
26+
- name: Grant execute permission for gradlew
27+
run: chmod +x gradlew
28+
29+
- name: Run Spotless Apply
30+
run: ./gradlew spotlessApply
31+
32+
- name: Check output
33+
run: git --no-pager diff --exit-code HEAD
34+
35+
- name: Generate diff
36+
run: git diff HEAD > javaformat-fixes.patch
37+
if: ${{ failure() }}
38+
39+
- uses: actions/upload-artifact@v4
40+
with:
41+
name: javaformat fixes
42+
path: javaformat-fixes.patch
43+
if: ${{ failure() }}
44+
45+
- name: Write to job summary
46+
run: |
47+
echo '```diff' >> $GITHUB_STEP_SUMMARY
48+
cat javaformat-fixes.patch >> $GITHUB_STEP_SUMMARY
49+
echo '' >> $GITHUB_STEP_SUMMARY
50+
echo '```' >> $GITHUB_STEP_SUMMARY
51+
if: ${{ failure() }}

.idea/misc.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)