Skip to content

Commit

Permalink
Create maven.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
jhalterman committed Aug 20, 2021
1 parent 2e37486 commit ad163c1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 14 deletions.
33 changes: 20 additions & 13 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,36 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Build

on:
push:
branches: [ $default-branch ]
pull_request:
branches: [ $default-branch ]
name: Java CI with Maven

on: [push, pull_request]

jobs:
build:
compile:
runs-on: ubuntu-latest

strategy:
matrix:
java: [ 8, 11, 12, 13 ]

name: Java ${{ matrix.java }} compile
steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
- name: Checkout Source Code
uses: actions/checkout@v2

- name: Setup Java
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
java-package: jdk
java-version: ${{ matrix.java }}

- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build with Maven
run: mvn -B package --file pom.xml

- name: Build with maven
run: mvn -B test
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.2</version>
<version>0.8.6</version>
<executions>
<execution>
<id>prepare-agent</id>
Expand Down

0 comments on commit ad163c1

Please sign in to comment.