mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-21 05:50:18 +08:00
45 lines
1.0 KiB
YAML
45 lines
1.0 KiB
YAML
|
|
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:
|
|
- uses: actions/checkout@v1
|
|
- name: Set up JDK 1.11
|
|
uses: actions/setup-java@v1
|
|
with:
|
|
java-version: 1.11
|
|
- 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
|
|
- 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
|