Skip to content

[BLOOM-002] 식물 저장, 전체 조회, 상세 조회 API 개발 #15

[BLOOM-002] 식물 저장, 전체 조회, 상세 조회 API 개발

[BLOOM-002] 식물 저장, 전체 조회, 상세 조회 API 개발 #15

Workflow file for this run

name: Spring Kotlin CI with MySQL
on:
push:
branches:
- '**'
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.4
env:
MYSQL_ROOT_PASSWORD: 1234
MYSQL_DATABASE: blueming
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping --silent" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Print MySQL logs for debugging
if: failure()
run: docker logs ${{ job.services.mysql.id }}
- name: Build with Gradle
run: ./gradlew build --warning-mode all
env:
SPRING_DATASOURCE_URL: jdbc:mysql://localhost:3306/blueming
SPRING_DATASOURCE_USERNAME: root
SPRING_DATASOURCE_PASSWORD: 1234
- name: Run tests
run: ./gradlew test --warning-mode all
env:
SPRING_DATASOURCE_URL: jdbc:mysql://localhost:3306/blueming
SPRING_DATASOURCE_USERNAME: root
SPRING_DATASOURCE_PASSWORD: 1234
- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle