Plex-FAWE/.github/workflows/build.yml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

59 lines
2.0 KiB
YAML
Raw Normal View History

2020-11-23 17:49:08 +00:00
name: "build"
on: ["pull_request", "push"]
jobs:
build:
strategy:
matrix:
2021-04-05 21:02:56 +00:00
java: ["8", "11"]
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"
- name: "Setup JDK ${{ matrix.java }}"
2021-04-05 21:02:56 +00:00
uses: "actions/setup-java@v2"
2020-11-23 17:49:08 +00:00
with:
2021-04-05 21:02:56 +00:00
distribution: "adopt"
2020-11-23 17:49:08 +00:00
java-version: "${{ matrix.java }}"
- name: "Cache Gradle"
2021-02-18 19:19:37 +00:00
uses: "actions/cache@v2.1.4"
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-02-18 19:19:37 +00:00
uses: "actions/cache@v2.1.4"
2020-11-23 17:49:08 +00:00
with:
path: "~/.m2/repository"
key: "${{ runner.os }}-${{ matrix.java }}-maven-${{ hashFiles('**/pom.xml') }}"
restore-keys: |
"${{ runner.os }}-${{ matrix.java }}-maven-"
- name: "Cache BuildTools Decompiled Code"
2021-02-18 19:19:37 +00:00
uses: "actions/cache@v2.1.4"
2020-11-23 17:49:08 +00:00
with:
path: "$GITHUB_WORKSPACE/work"
key: "${{ runner.os }}-buildtools"
restore-keys: |
"${{ runner.os }}-buildtools"
- name: "Test Enviornment"
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-01-31 08:31:06 +00:00
run: "./gradlew clean build -x test sourcesJar javadocJar"
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
2020-11-23 17:49:08 +00:00