Skip to content

Commit

Permalink
chore: backend-ci (#10)
Browse files Browse the repository at this point in the history
* chore: backend-ci 1차

* chore: backend-ci 2차

* chore: backend-ci 3차
  • Loading branch information
lsh1215 authored Oct 8, 2024
1 parent f2f0137 commit 9e1b482
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/backend-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: CI

on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop

jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read


steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up JDK 17 (Amazon Corretto)
uses: actions/setup-java@v4
with:
# distribution: 'corretto' # 올바른 배포판 이름
distribution: 'temurin'
java-version: '17'

- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper/
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Grant execute permission for Gradle wrapper
run: chmod +x gradlew

- name: Build with Gradle
run: ./gradlew build --no-daemon

- name: Run tests
run: ./gradlew test
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ dependencies {
// Database
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
runtimeOnly 'com.mysql:mysql-connector-j'
implementation 'com.h2database:h2:2.1.214'

// Lombok
annotationProcessor 'org.projectlombok:lombok'
Expand Down
20 changes: 20 additions & 0 deletions src/test/resources/application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
spring:
datasource:
url: jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE;MODE=MYSQL
username: sa
password:
driverClassName: org.h2.Driver
h2:
console:
enabled: true
path: /h2-console
jpa:
hibernate:
ddl-auto: update
show-sql: true
properties:
hibernate:
dialect: org.hibernate.dialect.MySQLDialect

config:
import: "optional:file:backend-secret.env[.properties]"

0 comments on commit 9e1b482

Please sign in to comment.