Skip to content

Commit 5d19c1a

Browse files
Added ci
1 parent 27a7962 commit 5d19c1a

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

.github/workflows/ci.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Java CI with Gradle
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v2
18+
19+
- name: Set up JDK 11
20+
uses: actions/setup-java@v3
21+
with:
22+
java-version: '11'
23+
distribution: 'adoptopenjdk' # Ensure you're using a distribution of your choice
24+
25+
- name: Cache Gradle dependencies
26+
uses: actions/cache@v2
27+
with:
28+
path: ~/.gradle/caches
29+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
30+
restore-keys: |
31+
${{ runner.os }}-gradle-
32+
33+
- name: Build with Gradle
34+
run: ./gradlew build --no-daemon
35+
36+
- name: Run tests
37+
run: ./gradlew test --no-daemon
38+
39+
- name: Upload test results
40+
if: always()
41+
uses: actions/upload-artifact@v2
42+
with:
43+
name: test-results
44+
path: build/test-results/test

0 commit comments

Comments
 (0)