FastAsyncWorldEdit/.github/workflows/build.yml

Revisionen in .git-blame-ignore-revs werden ignoriert. Klicke hier, um das zu umgehen und die normale Blame-Ansicht zu sehen.

56 Zeilen
1.9 KiB
YAML

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