Skip to content

Commit b10aacf

Browse files
committed
add worklfow
1 parent 61dddc8 commit b10aacf

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

.github/workflows/test.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Java Gradle Build and Test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v3
16+
17+
- name: Set up JDK 17
18+
uses: actions/setup-java@v3
19+
with:
20+
java-version: '17'
21+
distribution: 'temurin'
22+
23+
- name: Cache Gradle dependencies
24+
uses: actions/cache@v3
25+
with:
26+
path: ~/.gradle/caches
27+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
28+
restore-keys: |
29+
${{ runner.os }}-gradle-
30+
31+
- name: Verify Gradle wrapper
32+
run: ./gradlew wrapper --gradle-version
33+
34+
- name: Build and test
35+
run: ./gradlew build test
36+
37+
- name: Build shadow JAR
38+
run: ./gradlew shadowJar
39+
40+
- name: Upload shadow JAR artifact
41+
uses: actions/upload-artifact@v3
42+
with:
43+
name: shadow-jar
44+
path: build/libs/*-all.jar

0 commit comments

Comments
 (0)