Skip to content

Merge pull request #388 from josdem/feature/380 #166

Merge pull request #388 from josdem/feature/380

Merge pull request #388 from josdem/feature/380 #166

Workflow file for this run

name: Run Tests
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
HOST: localhost
DATABASE: vetlog
USER: ${{ secrets.USERNAME }}
PASSWORD: ${{ secrets.PASSWORD }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
cache: gradle
- name: Start MySQL
run: |
sudo /etc/init.d/mysql start
mysql -e "CREATE DATABASE $DATABASE;" -u$USER -p$PASSWORD
- name: Set up MySQL
run: ./gradlew -Dflyway.user=$USER -Dflyway.password=$PASSWORD -Dflyway.baselineOnMigrate=true flywayMigrate -i
- name: Build with Gradle
run: ./gradlew -Dflyway.user=$USER -Dflyway.password=$PASSWORD test jacocoTestReport sonar
- uses: actions/upload-artifact@v4
with:
name: test-results
path: build/reports/tests/test/
retention-days: 30