2020-05-29 10:45:54 +02:00
|
|
|
|
|
|
|
name: Java PR CI
|
|
|
|
|
|
|
|
on: [pull_request]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
services:
|
|
|
|
mariadb:
|
|
|
|
image: mariadb:latest
|
|
|
|
ports:
|
|
|
|
- 3306
|
|
|
|
env:
|
|
|
|
MYSQL_USER: user
|
|
|
|
MYSQL_PASSWORD: password
|
|
|
|
MYSQL_DATABASE: test
|
|
|
|
MYSQL_ROOT_PASSWORD: password
|
|
|
|
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
|
|
|
|
|
|
|
|
steps:
|
2021-07-23 15:49:34 +02:00
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Set up JDK 1.16
|
|
|
|
uses: actions/setup-java@v2
|
2020-05-29 10:45:54 +02:00
|
|
|
with:
|
2021-07-23 15:49:34 +02:00
|
|
|
distribution: 'adopt'
|
|
|
|
java-version: '16'
|
2020-05-29 10:45:54 +02:00
|
|
|
- name: Verify MariaDB connection
|
|
|
|
env:
|
|
|
|
PORT: ${{ job.services.mariadb.ports[3306] }}
|
|
|
|
run: |
|
|
|
|
while ! mysqladmin ping -h"127.0.0.1" -P"$PORT" --silent; do
|
|
|
|
sleep 1
|
|
|
|
done
|
2021-07-23 15:49:34 +02:00
|
|
|
- name: Cache Gradle packages
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.gradle/caches
|
|
|
|
~/.gradle/wrapper
|
|
|
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-gradle-
|
2020-05-29 10:45:54 +02:00
|
|
|
- name: Build with Gradle
|
|
|
|
env:
|
|
|
|
MYSQL_DB: test
|
|
|
|
MYSQL_USER: user
|
|
|
|
MYSQL_PASS: password
|
|
|
|
MYSQL_PORT: ${{ job.services.mariadb.ports[3306] }}
|
|
|
|
run: |
|
|
|
|
cd Plan
|
|
|
|
./gradlew build
|
2021-07-23 15:49:34 +02:00
|
|
|
- name: Cleanup Gradle cache
|
|
|
|
# Remove some files from the Gradle cache, so they aren't cached by GitHub Actions.
|
|
|
|
# Restoring these files from a GitHub Actions cache might cause problems for future builds.
|
|
|
|
run: |
|
|
|
|
rm -f ~/.gradle/caches/modules-2/modules-2.lock
|
|
|
|
rm -f ~/.gradle/caches/modules-2/gc.properties
|