[CORE] Gradle Migration - Better Build System when building against P… #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Java CI with Gradle | |
on: [push, pull_request] | |
jobs: | |
compile: | |
if: "!contains(github.event.head_commit.message, 'ci-skip') || !contains(github.event.head_commit.message, 'CI-SKIP') || !contains(github.event.head_commit.message, 'CI SKIP') || !contains(github.event.head_commit.message, 'ci skip') " | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
java: ['21', '23'] | |
steps: | |
# 1. Check out the current working tree | |
- name: Checkout ArmorStandEditor Repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | |
# 2. Setup Java JDK | |
- name: Set up JDK Environments | |
uses: actions/setup-java@v4 | |
with: | |
java-version: ${{ matrix.java }} | |
distribution: 'zulu' | |
# 3. Setup local Gradle cache to speed up building | |
- name: Cache Gradle packages | |
uses: actions/cache@v3 | |
with: | |
path: ~/.gradle/caches | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: ${{ runner.os }}-gradle | |
# 4. Build and analyze | |
- name: Build and analyze | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
run: ./gradlew build sonarqube -Dsonar.projectKey=wolfieheart_ArmorStandEditor | |
# 5. Create a Clean Package - and Verify it | |
- name: Clean and build | |
run: ./gradlew clean build | |
- name: Verify build | |
run: ./gradlew clean test | |
# 6. Upload Artifacts (Debug Purposes) | |
- name: Upload Artifact for Debugging | |
uses: actions/[email protected] | |
if: success() && matrix.java == '21' | |
with: | |
name: artifact | |
path: build/libs/armorstandeditor-*-*.jar | |
if-no-files-found: error |