2020-11-23 17:49:08 +00:00
|
|
|
name: "build"
|
|
|
|
|
|
|
|
on: ["pull_request", "push"]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2021-02-18 19:19:37 +00:00
|
|
|
os: ["ubuntu-latest"]
|
2020-11-23 17:49:08 +00:00
|
|
|
runs-on: "${{ matrix.os }}"
|
|
|
|
steps:
|
|
|
|
- name: "Checkout Repository"
|
|
|
|
uses: "actions/checkout@v2.3.4"
|
2021-07-01 20:16:25 +00:00
|
|
|
- name: "Setup JDK 16"
|
|
|
|
uses: "actions/setup-java@v2.1.0"
|
2020-11-23 17:49:08 +00:00
|
|
|
with:
|
2021-04-05 21:02:56 +00:00
|
|
|
distribution: "adopt"
|
2021-07-01 20:16:25 +00:00
|
|
|
java-version: "16"
|
2020-11-23 17:49:08 +00:00
|
|
|
- name: "Cache Gradle"
|
2021-07-01 20:16:25 +00:00
|
|
|
uses: "actions/cache@v2.1.6"
|
2020-11-23 17:49:08 +00:00
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
"~/.gradle/caches"
|
|
|
|
"~/.gradle/wrapper"
|
2021-02-18 19:19:37 +00:00
|
|
|
key: "${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}"
|
2020-11-23 17:49:08 +00:00
|
|
|
restore-keys: |
|
2021-02-18 19:19:37 +00:00
|
|
|
"${{ runner.os }}-gradle-"
|
2020-11-23 17:49:08 +00:00
|
|
|
- name: "Cache Local Maven Repository"
|
2021-07-01 20:16:25 +00:00
|
|
|
uses: "actions/cache@v2.1.6"
|
2020-11-23 17:49:08 +00:00
|
|
|
with:
|
|
|
|
path: "~/.m2/repository"
|
2021-05-14 21:46:49 +00:00
|
|
|
key: "${{ runner.os }}-11-maven-${{ hashFiles('**/pom.xml') }}"
|
2020-11-23 17:49:08 +00:00
|
|
|
restore-keys: |
|
2021-05-14 21:46:49 +00:00
|
|
|
"${{ runner.os }}-11-maven-"
|
2020-11-23 17:49:08 +00:00
|
|
|
- name: "Cache BuildTools Decompiled Code"
|
2021-07-01 20:16:25 +00:00
|
|
|
uses: "actions/cache@v2.1.6"
|
2020-11-23 17:49:08 +00:00
|
|
|
with:
|
|
|
|
path: "$GITHUB_WORKSPACE/work"
|
|
|
|
key: "${{ runner.os }}-buildtools"
|
|
|
|
restore-keys: |
|
|
|
|
"${{ runner.os }}-buildtools"
|
2021-05-14 21:46:49 +00:00
|
|
|
- name: "Test Environment"
|
2020-11-23 17:49:08 +00:00
|
|
|
run: "echo $GITHUB_WORKSPACE"
|
|
|
|
- name: "Download BuildTools"
|
|
|
|
run: "wget https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar"
|
|
|
|
- name: "Run BuildTools"
|
2021-01-19 18:50:43 +00:00
|
|
|
run: "java -jar BuildTools.jar --rev 1.16.5"
|
2020-11-23 17:49:08 +00:00
|
|
|
- name: "Clean Build"
|
2021-07-01 20:16:25 +00:00
|
|
|
run: "./gradlew clean build sourcesJar javadocJar -x test"
|
2021-02-18 19:19:37 +00:00
|
|
|
- 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
|