Update build.yml

This commit is contained in:
Matt 2021-02-18 14:19:37 -05:00 committed by GitHub
parent 80b6a100e8
commit 14c0d4a5e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,7 +7,7 @@ jobs:
strategy: strategy:
matrix: matrix:
java: ["1.8", "11"] java: ["1.8", "11"]
os: ["ubuntu-18.04"] os: ["ubuntu-latest"]
runs-on: "${{ matrix.os }}" runs-on: "${{ matrix.os }}"
steps: steps:
- name: "Checkout Repository" - name: "Checkout Repository"
@ -17,23 +17,23 @@ jobs:
with: with:
java-version: "${{ matrix.java }}" java-version: "${{ matrix.java }}"
- name: "Cache Gradle" - name: "Cache Gradle"
uses: "actions/cache@v2.1.3" uses: "actions/cache@v2.1.4"
with: with:
path: | path: |
"~/.gradle/caches" "~/.gradle/caches"
"~/.gradle/wrapper" "~/.gradle/wrapper"
key: "${{ runner.os }}-${{ matrix.java }}-gradle-${{ hashFiles('**/*.gradle*') }}" key: "${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}"
restore-keys: | restore-keys: |
"${{ runner.os }}-${{ matrix.java }}-gradle-" "${{ runner.os }}-gradle-"
- name: "Cache Local Maven Repository" - name: "Cache Local Maven Repository"
uses: "actions/cache@v2.1.3" uses: "actions/cache@v2.1.4"
with: with:
path: "~/.m2/repository" path: "~/.m2/repository"
key: "${{ runner.os }}-${{ matrix.java }}-maven-${{ hashFiles('**/pom.xml') }}" key: "${{ runner.os }}-${{ matrix.java }}-maven-${{ hashFiles('**/pom.xml') }}"
restore-keys: | restore-keys: |
"${{ runner.os }}-${{ matrix.java }}-maven-" "${{ runner.os }}-${{ matrix.java }}-maven-"
- name: "Cache BuildTools Decompiled Code" - name: "Cache BuildTools Decompiled Code"
uses: "actions/cache@v2.1.3" uses: "actions/cache@v2.1.4"
with: with:
path: "$GITHUB_WORKSPACE/work" path: "$GITHUB_WORKSPACE/work"
key: "${{ runner.os }}-buildtools" key: "${{ runner.os }}-buildtools"
@ -47,4 +47,11 @@ jobs:
run: "java -jar BuildTools.jar --rev 1.16.5" run: "java -jar BuildTools.jar --rev 1.16.5"
- name: "Clean Build" - name: "Clean Build"
run: "./gradlew clean build -x test sourcesJar javadocJar" run: "./gradlew clean build -x test sourcesJar javadocJar"
- 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