2019-12-10 12:09:08 +01:00
|
|
|
|
|
|
|
name: Java CI
|
|
|
|
|
2020-05-23 20:00:39 +02:00
|
|
|
on: [push, pull_request]
|
2019-12-10 12:09:08 +01:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
2020-05-09 09:16:05 +02:00
|
|
|
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
|
|
|
|
|
2019-12-10 12:09:08 +01:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
|
|
|
- name: Set up JDK 1.8
|
|
|
|
uses: actions/setup-java@v1
|
|
|
|
with:
|
|
|
|
java-version: 1.8
|
2020-05-09 09:16:05 +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
|
2019-12-10 12:09:08 +01:00
|
|
|
- name: Build with Gradle
|
2020-05-09 09:16:05 +02:00
|
|
|
env:
|
|
|
|
MYSQL_DB: test
|
|
|
|
MYSQL_USER: user
|
|
|
|
MYSQL_PASS: password
|
|
|
|
MYSQL_PORT: ${{ job.services.mariadb.ports[3306] }}
|
2019-12-10 12:09:08 +01:00
|
|
|
run: |
|
|
|
|
cd Plan
|
|
|
|
./gradlew build
|
|
|
|
- name: SonarCloud
|
|
|
|
run: |
|
|
|
|
cd Plan
|
2019-12-16 11:38:48 +01:00
|
|
|
./gradlew sonar -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=player-analytics-plan
|
2019-12-17 08:22:48 +01:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|