Add CI workflow configuration

This commit is contained in:
Nerosshini 2024-09-07 00:45:19 +08:00
parent 91328af12d
commit 6fdc53910b

38
.github/workflows/ci.yml vendored Normal file
View file

@ -0,0 +1,38 @@
name: Java CI with Gradle
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
- name: Build with Gradle
run: ./gradlew build
- name: Run tests
run: ./gradlew test
- name: Upload test results
uses: actions/upload-artifact@v3
with:
name: test-results
path: build/test-results/test
- name: Upload code coverage report
uses: actions/upload-artifact@v3
with:
name: jacoco-report
path: build/reports/jacoco/test/html