mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-22 17:18:40 +01:00
Build system & pipeline changes (#2024)
* Build system & pipeline changes - Updated Gradle to 7.1.1 & removed deprecations - Added Google Maven repository & updated Dagger to 2.38 - Set new options.release parameter for submodules, allows producing Java 8 -compatible bytecode with Java 16 (also ensures that no APIs from a newer version are used) - Updated workflows to use newer versions of checkout & setup-java - Added a Gradle dependency cache task to workflows, allows for faster builds * Cleanup cache after build
This commit is contained in:
parent
0ee1e40e4b
commit
cdbe21fb6f
24
.github/workflows/gradle-pr.yml
vendored
24
.github/workflows/gradle-pr.yml
vendored
@ -21,11 +21,12 @@ jobs:
|
||||
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up JDK 1.11
|
||||
uses: actions/setup-java@v1
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up JDK 1.16
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
java-version: 1.11
|
||||
distribution: 'adopt'
|
||||
java-version: '16'
|
||||
- name: Verify MariaDB connection
|
||||
env:
|
||||
PORT: ${{ job.services.mariadb.ports[3306] }}
|
||||
@ -33,6 +34,15 @@ jobs:
|
||||
while ! mysqladmin ping -h"127.0.0.1" -P"$PORT" --silent; do
|
||||
sleep 1
|
||||
done
|
||||
- name: Cache Gradle packages
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
~/.gradle/caches
|
||||
~/.gradle/wrapper
|
||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-gradle-
|
||||
- name: Build with Gradle
|
||||
env:
|
||||
MYSQL_DB: test
|
||||
@ -42,3 +52,9 @@ jobs:
|
||||
run: |
|
||||
cd Plan
|
||||
./gradlew build
|
||||
- name: Cleanup Gradle cache
|
||||
# Remove some files from the Gradle cache, so they aren't cached by GitHub Actions.
|
||||
# Restoring these files from a GitHub Actions cache might cause problems for future builds.
|
||||
run: |
|
||||
rm -f ~/.gradle/caches/modules-2/modules-2.lock
|
||||
rm -f ~/.gradle/caches/modules-2/gc.properties
|
||||
|
66
.github/workflows/gradle.yml
vendored
66
.github/workflows/gradle.yml
vendored
@ -21,31 +21,41 @@ jobs:
|
||||
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up JDK 1.11
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 1.11
|
||||
- name: Verify MariaDB connection
|
||||
env:
|
||||
PORT: ${{ job.services.mariadb.ports[3306] }}
|
||||
run: |
|
||||
while ! mysqladmin ping -h"127.0.0.1" -P"$PORT" --silent; do
|
||||
sleep 1
|
||||
done
|
||||
- name: Build with Gradle
|
||||
env:
|
||||
MYSQL_DB: test
|
||||
MYSQL_USER: user
|
||||
MYSQL_PASS: password
|
||||
MYSQL_PORT: ${{ job.services.mariadb.ports[3306] }}
|
||||
run: |
|
||||
cd Plan
|
||||
./gradlew build
|
||||
- name: SonarCloud
|
||||
run: |
|
||||
cd Plan
|
||||
./gradlew sonar -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=player-analytics-plan
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up JDK 1.16
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
distribution: 'adopt'
|
||||
java-version: '16'
|
||||
- name: Verify MariaDB connection
|
||||
env:
|
||||
PORT: ${{ job.services.mariadb.ports[3306] }}
|
||||
run: |
|
||||
while ! mysqladmin ping -h"127.0.0.1" -P"$PORT" --silent; do
|
||||
sleep 1
|
||||
done
|
||||
- name: Cache Gradle packages
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
~/.gradle/caches
|
||||
~/.gradle/wrapper
|
||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-gradle-
|
||||
- name: Build with Gradle
|
||||
env:
|
||||
MYSQL_DB: test
|
||||
MYSQL_USER: user
|
||||
MYSQL_PASS: password
|
||||
MYSQL_PORT: ${{ job.services.mariadb.ports[3306] }}
|
||||
run: |
|
||||
cd Plan
|
||||
./gradlew build
|
||||
- name: SonarCloud
|
||||
run: |
|
||||
cd Plan
|
||||
./gradlew sonar -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=player-analytics-plan
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
|
@ -12,8 +12,6 @@ plugins {
|
||||
id "jacoco"
|
||||
id "checkstyle"
|
||||
id "org.sonarqube" version "3.3"
|
||||
// id "net.ltgt.apt" version "0.21"
|
||||
// id "net.ltgt.apt-idea" version "0.21"
|
||||
}
|
||||
|
||||
apply plugin: 'nebula-aggregate-javadocs'
|
||||
@ -30,7 +28,6 @@ def determineBuildVersion = {
|
||||
def buildVersion = determineBuildVersion()
|
||||
|
||||
allprojects {
|
||||
wrapper.gradleVersion = "7.0.2"
|
||||
|
||||
group "com.djrapitops"
|
||||
version "5.4-SNAPSHOT"
|
||||
@ -58,12 +55,13 @@ subprojects {
|
||||
apply plugin: "checkstyle"
|
||||
apply plugin: "jacoco"
|
||||
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
compileJava {
|
||||
options.release = 8
|
||||
}
|
||||
|
||||
ext {
|
||||
daggerVersion = "2.37"
|
||||
daggerCompilerVersion = "2.37"
|
||||
daggerVersion = "2.38"
|
||||
daggerCompilerVersion = "2.38"
|
||||
|
||||
palVersion = "5.0.0"
|
||||
|
||||
@ -92,6 +90,7 @@ subprojects {
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
google()
|
||||
maven { url = "https://hub.spigotmc.org/nexus/content/repositories/snapshots/" } // Spigot
|
||||
maven { url = "https://papermc.io/repo/repository/maven-public/" } // Paper
|
||||
maven { url = "https://repo.spongepowered.org/repository/maven-public/" } // Sponge
|
||||
@ -146,7 +145,7 @@ subprojects {
|
||||
|
||||
jacocoTestReport {
|
||||
reports {
|
||||
xml.enabled true
|
||||
xml.required = true
|
||||
// xml.destination file("${buildDir}/jacoco/report.xml")
|
||||
}
|
||||
}
|
||||
|
BIN
Plan/gradle/wrapper/gradle-wrapper.jar
vendored
BIN
Plan/gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
2
Plan/gradlew
vendored
2
Plan/gradlew
vendored
@ -72,7 +72,7 @@ case "`uname`" in
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
MSYS* | MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
NONSTOP* )
|
||||
|
Loading…
Reference in New Issue
Block a user