63 lines
1.6 KiB
YAML
63 lines
1.6 KiB
YAML
name: Java CI with Gradle
|
|
|
|
on:
|
|
push:
|
|
branches: [ "main", "develop" ]
|
|
tags: [ "v*" ]
|
|
pull_request:
|
|
branches: [ "main", "develop" ]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Set up JDK 25
|
|
uses: actions/setup-java@v6
|
|
with:
|
|
java-version: '25'
|
|
distribution: 'temurin'
|
|
|
|
- name: Setup Gradle 9.8.0
|
|
uses: gradle/actions/setup-gradle@v5
|
|
with:
|
|
gradle-version: '9.8.0'
|
|
cache-read-only: ${{ github.ref != 'refs/heads/develop' && github.ref != 'refs/heads/main' }}
|
|
|
|
- name: Run Unit Tests
|
|
run: ./gradlew test
|
|
|
|
- name: Upload Test Report
|
|
if: always()
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: ScoreKeeper-test-report
|
|
path: |
|
|
build/reports/tests/test
|
|
build/test-results/test
|
|
if-no-files-found: ignore
|
|
retention-days: 14
|
|
|
|
- name: Build with Gradle Wrapper
|
|
run: ./tools/build-plugin.sh
|
|
|
|
- name: Extract Project Version
|
|
id: project_info
|
|
run: |
|
|
VERSION=$(./gradlew properties --no-daemon -q | awk -F ': ' '$1 == "version" {print $2}')
|
|
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
|
|
|
- name: Upload Plugin Artifact
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: ScoreKeeper-${{ steps.project_info.outputs.version }}
|
|
path: build/libs/*.jar
|
|
if-no-files-found: error
|
|
retention-days: 14
|