From 3b311892220e69dacbe423dec07e696dbebf4898 Mon Sep 17 00:00:00 2001 From: Connor Tumbleson Date: Mon, 31 May 2021 06:54:26 -0400 Subject: [PATCH] build: cache gradle based on java version --- .github/workflows/test.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index aa906fbd..8c358d86 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,6 +15,7 @@ on: jobs: build-and-test-with-Java-8-and-later: + runs-on: ${{ matrix.os }} name: Build/Test (JDK ${{ matrix.java }}, ${{ matrix.os }}) strategy: fail-fast: false @@ -22,24 +23,27 @@ jobs: matrix: os: [ubuntu-latest, macOS-latest, windows-latest] java: [8, 9, 10, 11, 12, 13, 14] - runs-on: ${{ matrix.os }} + steps: - uses: actions/cache@v2 with: path: | ~/.gradle/caches ~/.gradle/wrapper - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} - restore-keys: | - ${{ runner.os }}-gradle- + key: ${{ runner.os }}-gradle-${{ matrix.java }}-${{ hashFiles('**/*.gradle*') }} + restore-keys: ${{ runner.os }}-${{ matrix.java }}-gradle- + - uses: actions/checkout@v2 + - name: Set up JDK ${{ matrix.java }} uses: actions/setup-java@v1 with: java-version: ${{ matrix.java }} + - name: Build and test - run: ./gradlew.bat build shadowJar proguard if: startsWith(matrix.os, 'windows') == true + run: ./gradlew.bat build shadowJar proguard + - name: Build and test + if: startsWith(matrix.os, 'windows') != true run: ./gradlew build shadowJar proguard - if: startsWith(matrix.os, 'windows') != true \ No newline at end of file