Skip to content

Commit

Permalink
ci(.github): CI 작성 (#6)
Browse files Browse the repository at this point in the history
* ci(.github): CI 작성

* ci(application.yml): test시에 h2 memory db 사용하도록 연결

---------

Co-authored-by: bo <[email protected]>
  • Loading branch information
Woongbin06 and jacobhboy authored Dec 26, 2023
1 parent 60bbe9c commit 47c3828
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Java CI with Gradle

on:
pull_request:
branches: [ "master" ]

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build with Gradle
run: ./gradlew clean build
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ dependencies {
runtimeOnly 'com.mysql:mysql-connector-j'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'

testRuntimeOnly 'com.h2database:h2'
}

tasks.named('test') {
Expand Down
18 changes: 18 additions & 0 deletions src/test/resources/application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
spring:
datasource:
url: jdbc:h2:mem:testdb;MODE=MySQL;NON_KEYWORDS=USER
username: sa
password:
jpa:
show-sql: true
properties:
hibernate:
format_sql: true
default_batch_fetch_size: 30
defer-datasource-initialization: true
sql:
init:
mode: always
h2:
console:
enabled: true

0 comments on commit 47c3828

Please sign in to comment.