Skip to content

Commit 7202d92

Browse files
committed
Add github workflow to run on each push
1 parent 96daab1 commit 7202d92

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

.github/workflows/maven.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Java CI
2+
3+
on:
4+
push:
5+
branches: [ '*' ]
6+
pull_request: {}
7+
8+
jobs:
9+
build:
10+
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Cache Maven packages
15+
uses: actions/cache@v2
16+
with:
17+
path: ~/.m2
18+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
19+
restore-keys: ${{ runner.os }}-m2
20+
- name: Set up JDK 8 for toolchain
21+
id: setup-java8
22+
uses: actions/setup-java@v2
23+
with:
24+
java-version: 8
25+
distribution: 'zulu'
26+
- name: Set up JDK 16
27+
uses: actions/setup-java@v2
28+
with:
29+
java-version: 16
30+
distribution: 'zulu'
31+
- name: Build with Maven
32+
run: export JAVA8_HOME=${{ steps.setup-java8.outputs.path }} && mvn -B verify -Dgpg.skip=true --global-toolchains .github/workflows/toolchains.xml

.github/workflows/toolchains.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF8"?>
2+
<toolchains>
3+
<toolchain>
4+
<type>jdk</type>
5+
<provides>
6+
<version>1.8</version>
7+
</provides>
8+
<configuration>
9+
<jdkHome>${env.JAVA8_HOME}</jdkHome>
10+
</configuration>
11+
</toolchain>
12+
</toolchains>

0 commit comments

Comments
 (0)