Update maven.yml

This commit is contained in:
Jamie O'Meara 2021-05-12 12:32:18 -06:00 committed by GitHub
parent aba969375a
commit 90077b2259
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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.*'