From 90077b225947bc2cb3f33edeea41dd521bbedfe6 Mon Sep 17 00:00:00 2001 From: Jamie O'Meara Date: Wed, 12 May 2021 12:32:18 -0600 Subject: [PATCH] Update maven.yml --- .github/workflows/maven.yml | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 74f4bc611..945ba4e64 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -9,7 +9,7 @@ on: pull_request: jobs: - build-and-test: + build-and-test-matrix: runs-on: ubuntu-latest strategy: @@ -32,14 +32,37 @@ jobs: distribution: 'adopt' java-version: ${{ matrix.java-version }} - run: mvn -B install --no-transfer-progress --file pom.xml + + - name: Upload Artifact + uses: actions/upload-artifact@v2 + with: + name: spring-petclinic + path: ${{ github.workspace }}/target/spring-petclinic* + build-image-and-publish: runs-on: ubuntu-latest - needs: [build-and-test] + needs: [build-and-test-matrix] steps: + - uses: actions/checkout@v2 - + + - name: Cache local Maven repository + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + + - name: Setup Java and Build + uses: actions/setup-java@v2 + with: + distribution: 'adopt' + java-version: 8 + - run: mvn -B install --no-transfer-progress --file pom.xml + - name: Build image uses: bigloupe/buildpacks-action@master with: @@ -47,4 +70,4 @@ jobs: tag: '1.0.0' path: 'target/spring-petclinic-2.4.5.jar' builder: 'gcr.io/paketo-buildpacks/builder:tiny' - env: 'HELLO=WORLD FOO=BAR BAZ' + env: 'BP_JVM_VERSION=8.*'