From 564bb6b993240161014920d2166d06baf8a7bb2b Mon Sep 17 00:00:00 2001 From: WhitePiano Date: Tue, 23 Jan 2024 19:26:11 +0900 Subject: [PATCH] =?UTF-8?q?[Setting]=20`.github`=20=EC=84=A4=EC=A0=95=20(#?= =?UTF-8?q?28)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * conf(CODEOWNERS): 코드오너 설정 * conf(PULL_REQUEST_TEMPLATE): PR 탬플릿 등록 * conf(ISSUE_TEMPLATE): ISSUE 탬플릿 등록 * conf(Continuous Intergration.yml): ISSUE 탬플릿 등록 * fix: gradle build가 동작하도록 `임시` 수정 * fix: gradle build가 성공하도록 권한 설정 * fix: CI 과정에서 submodule을 가져오도록 설정 * fix: CI 과정에 PAT 추가 * fix: CI 과정에 DB ENV 설정 * fix: jpa driver 명시 * fix: jpa db 명시 * fix: application properties 통일 * fix: firebaseconfig 재활성화 * fix: update submodule * fix: kapt 및 boot 버전 맞춰주기 * fix: github action jvm distribution 수정 * refactor: CI 빌드를 소란스럽게 * fix: mySQL 8.3.0과 testcontainer 설정 충돌 해결 * refactor: CI가 간결하게 logging하도록 설정 --- .github/CODEOWNERS | 1 + .github/ISSUE_TEMPLATE/1-FEAT.md | 17 +++++++ .github/ISSUE_TEMPLATE/config.yml | 1 + .github/PULL_REQUEST_TEMPLATE.md | 21 +++++++++ .github/workflows/Continuous Integration.yml | 35 ++++++++++++++ build.gradle.kts | 10 ++-- src/main/resources/application.yml | 7 ++- src/main/resources/mysql-default-conf/my.cnf | 49 ++++++++++++++++++++ src/test/resources/application.yml | 18 +++---- 9 files changed, 143 insertions(+), 16 deletions(-) create mode 100644 .github/CODEOWNERS create mode 100644 .github/ISSUE_TEMPLATE/1-FEAT.md create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/workflows/Continuous Integration.yml create mode 100644 src/main/resources/mysql-default-conf/my.cnf diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..3e2e32c --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @goldentrash @zbqmgldjfh diff --git a/.github/ISSUE_TEMPLATE/1-FEAT.md b/.github/ISSUE_TEMPLATE/1-FEAT.md new file mode 100644 index 0000000..7cdb8b0 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/1-FEAT.md @@ -0,0 +1,17 @@ +--- +name: Feature Request +description: 새로운 기능 구현 +title: "[Feat]: ~~" +labels: "🚀 기능 구현 🚀" +assignees: '' + +--- + +# 개요 + +~~ 기능 구현 + +## Todo + +- [ ] ~~ 기능 +- [ ] ~~ 기능 diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..3ba13e0 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1 @@ +blank_issues_enabled: false diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..684aa6f --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,21 @@ +# 개요 + +~~ 기능 구현 (close #00) + +## Todo + +- [ ] ~~ 테스트 작성 +- [ ] ~~ 모듈 구현 + +## 논의가 필요한 사항 + +~~ 모듈 구현 간에 ~~ 보다 더 좋은 방법이 있을까요? + +--- + +### 등록 전 확인 + +- [ ] 모든 test가 pass했나요? +- [ ] 모든 code가 well-formatted인가요? +- [ ] commit message는 직관적이었을까요? +- [ ] 삭제해야 할, 주석처리 된 코드는 없을까요? diff --git a/.github/workflows/Continuous Integration.yml b/.github/workflows/Continuous Integration.yml new file mode 100644 index 0000000..2fb5605 --- /dev/null +++ b/.github/workflows/Continuous Integration.yml @@ -0,0 +1,35 @@ +name: Continuous Integration + +on: + pull_request: + branches: + - 'develop' + +jobs: + Test: + runs-on: ubuntu-22.04 + + env: + DB_URL: ${{ secrets.DB_URL }} + DB_USER: ${{ secrets.DB_USR }} + DB_PASSWORD: ${{ secrets.DB_PWD }} + + steps: + - name: Set up sources + uses: actions/checkout@v4 + with: + token: ${{ secrets.GH_TOKEN }} + submodules: true + + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: 17 + distribution: corretto + cache: gradle + + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 + + - name: Execute Gradle build + run: ./gradlew build diff --git a/build.gradle.kts b/build.gradle.kts index 7afc595..75ca3ad 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -3,7 +3,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { id("org.springframework.boot") version "3.2.1" id("io.spring.dependency-management") version "1.1.4" - kotlin("kapt") version "1.9.21" + kotlin("kapt") version "1.9.20" kotlin("jvm") version "1.9.21" kotlin("plugin.spring") version "1.9.21" kotlin("plugin.jpa") version "1.9.21" @@ -21,9 +21,9 @@ allOpen { } noArg { - annotation("javax.persistence.Entity") - annotation("javax.persistence.MappedSuperclass") - annotation("javax.persistence.Embeddable") + annotation("jakarta.persistence.Entity") + annotation("jakarta.persistence.MappedSuperclass") + annotation("jakarta.persistence.Embeddable") } java { @@ -55,7 +55,7 @@ dependencies { // QueryDsl implementation("com.querydsl:querydsl-jpa:5.0.0") - kapt("com.querydsl:querydsl-apt:5.0.0:jpa") + kapt("com.querydsl:querydsl-apt:5.0.0:jakarta") kapt("org.springframework.boot:spring-boot-configuration-processor") // firebase diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 7e29226..4dfb374 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -1,5 +1,7 @@ spring: jpa: + database: mysql + database-platform: org.hibernate.dialect.MySQLDialect hibernate: ddl-auto: create properties: @@ -9,9 +11,10 @@ spring: show-sql: false open-in-view: false datasource: - password: ${DB_PASSWORD} - username: ${DB_USER} url: ${DB_URL} + username: ${DB_USER} + password: ${DB_PASSWORD} + driver-class-name: com.mysql.cj.jdbc.Driver local: image: diff --git a/src/main/resources/mysql-default-conf/my.cnf b/src/main/resources/mysql-default-conf/my.cnf new file mode 100644 index 0000000..ee758e8 --- /dev/null +++ b/src/main/resources/mysql-default-conf/my.cnf @@ -0,0 +1,49 @@ +[mysqld] +user = mysql +datadir = /var/lib/mysql +port = 3306 +#socket = /tmp/mysql.sock +skip-external-locking +key_buffer_size = 16K +max_allowed_packet = 1M +table_open_cache = 4 +sort_buffer_size = 64K +read_buffer_size = 256K +read_rnd_buffer_size = 256K +net_buffer_length = 2K +host_cache_size=0 +skip-name-resolve + +# Don't listen on a TCP/IP port at all. This can be a security enhancement, +# if all processes that need to connect to mysqld run on the same host. +# All interaction with mysqld must be made via Unix sockets or named pipes. +# Note that using this option without enabling named pipes on Windows +# (using the "enable-named-pipe" option) will render mysqld useless! +# +#skip-networking +#server-id = 1 + +# Uncomment the following if you want to log updates +#log-bin=mysql-bin + +# binary logging format - mixed recommended +#binlog_format=mixed + +# Causes updates to non-transactional engines using statement format to be +# written directly to binary log. Before using this option make sure that +# there are no dependencies between transactional and non-transactional +# tables such as in the statement INSERT INTO t_myisam SELECT * FROM +# t_innodb; otherwise, slaves may diverge from the master. +#binlog_direct_non_transactional_updates=TRUE + +# Uncomment the following if you are using InnoDB tables +innodb_data_file_path = ibdata1:10M:autoextend +# You can set .._buffer_pool_size up to 50 - 80 % +# of RAM but beware of setting memory usage too high +innodb_buffer_pool_size = 16M +#innodb_additional_mem_pool_size = 2M +# Set .._log_file_size to 25 % of buffer pool size +innodb_log_file_size = 5M +innodb_log_buffer_size = 8M +innodb_flush_log_at_trx_commit = 1 +innodb_lock_wait_timeout = 50 diff --git a/src/test/resources/application.yml b/src/test/resources/application.yml index b851355..63c6397 100644 --- a/src/test/resources/application.yml +++ b/src/test/resources/application.yml @@ -1,19 +1,19 @@ spring: - datasource: - url: jdbc:tc:mysql:8:///plantory?TC_REUSABLE=true - username: plantory - password: plantory1234 - driver-class-name: org.testcontainers.jdbc.ContainerDatabaseDriver - p6spy: - enable-logging: true jpa: + database: mysql + database-platform: org.hibernate.dialect.MySQLDialect hibernate: ddl-auto: create - open-in-view: false - show-sql: true properties: hibernate: format_sql: true + show-sql: true + open-in-view: false + datasource: + url: jdbc:tc:mysql:8:///plantory?TC_REUSABLE=true + username: plantory + password: plantory1234 + driver-class-name: org.testcontainers.jdbc.ContainerDatabaseDriver local: image: