-
-
Notifications
You must be signed in to change notification settings - Fork 29
36 lines (36 loc) · 1.03 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Run Tests
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
HOST: localhost
DATABASE: vetlog
USER: ${{ secrets.USERNAME }}
PASSWORD: ${{ secrets.PASSWORD }}
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
- uses: actions/upload-artifact@v4
with:
name: test-results
path: build/reports/tests/test/
retention-days: 30