2021-02-18 18:58:25 +01:00
|
|
|
# This workflow automatically tests new commits and pull requests as they come in.
|
|
|
|
# Note that this does not upload any artifacts, you will need to compile mcMMO manually
|
|
|
|
# if you wish to create the actual jar.
|
|
|
|
name: Compile and test
|
|
|
|
|
|
|
|
on:
|
|
|
|
# We run our tests whenever the pom or a source file was touched.
|
|
|
|
# There is no need to run Maven when only the changelog was touched.
|
|
|
|
# We may also want to re-run this workflow when the workflow file itself
|
|
|
|
# was updated too.
|
|
|
|
push:
|
|
|
|
paths:
|
|
|
|
- 'src/**'
|
|
|
|
- 'pom.xml'
|
|
|
|
- '.github/workflows/maven.yml'
|
|
|
|
|
|
|
|
# Whenever someone submits a new pull request which modified the pom or a source file,
|
|
|
|
# we want to ensure it compiles successfully and that all tests will pass.
|
|
|
|
pull_request:
|
|
|
|
paths:
|
|
|
|
- 'src/**'
|
|
|
|
- 'pom.xml'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
compile:
|
|
|
|
name: Maven compiler
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
|
|
|
|
# 1. Check out the current working tree
|
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
2021-12-12 06:21:22 +01:00
|
|
|
# 2. Setup Java 17 JDK (Adopt)
|
|
|
|
- name: Java 17 setup
|
2021-11-09 03:54:46 +01:00
|
|
|
uses: actions/setup-java@v2
|
2021-02-18 18:58:25 +01:00
|
|
|
with:
|
2021-11-09 03:54:46 +01:00
|
|
|
distribution: 'adopt'
|
2021-02-18 18:58:25 +01:00
|
|
|
java-package: jdk
|
2021-12-12 06:21:22 +01:00
|
|
|
java-version: '17'
|
2021-02-18 18:58:25 +01:00
|
|
|
|
|
|
|
# 3. Setup local Maven package cache to speed up building
|
|
|
|
- name: Cache Maven packages
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: ~/.m2
|
|
|
|
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
|
|
|
|
restore-keys: ${{ runner.os }}-m2
|
|
|
|
|
|
|
|
# 4. Build via Maven
|
|
|
|
- name: Build via Maven
|
|
|
|
run: mvn verify -B --file pom.xml
|