2021-03-21 13:03:23 +00:00
|
|
|
name: tests
|
2021-05-23 05:30:08 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
types: [ opened, synchronize, reopened ]
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
|
2021-03-21 13:03:23 +00:00
|
|
|
jobs:
|
|
|
|
run_tests:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout the repository
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Set up JDK 8
|
2021-07-31 17:10:24 +00:00
|
|
|
uses: actions/setup-java@v2.1.0
|
2021-03-21 13:03:23 +00:00
|
|
|
with:
|
|
|
|
java-version: 8
|
2021-07-31 21:47:07 +00:00
|
|
|
distribution: 'adopt'
|
2021-03-21 13:03:23 +00:00
|
|
|
|
2021-05-23 05:30:08 +00:00
|
|
|
- name: Cache local Maven repository
|
2021-03-21 13:03:23 +00:00
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
2021-05-23 05:30:08 +00:00
|
|
|
path: ~/.m2/repository
|
|
|
|
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-maven-
|
2021-03-21 13:03:23 +00:00
|
|
|
|
2021-05-23 05:30:08 +00:00
|
|
|
# Downloading all the dependencies is very log spammy so we do this in its own step.
|
|
|
|
# Also the cache is reused by the "release" workflow but the workflow here does not use all
|
|
|
|
# dependencies so without the priming step the cache will be missing some things.
|
|
|
|
- name: Prime Maven cache
|
|
|
|
run: mvn --batch-mode dependency:go-offline
|
2021-07-31 21:47:07 +00:00
|
|
|
|
2021-03-21 13:03:23 +00:00
|
|
|
- name: Run tests with Maven
|
2021-05-23 05:30:08 +00:00
|
|
|
run: mvn -B test --file pom.xml
|