-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* deploy: PR 생성시 테스트코드 수행 로직 추가 * feat: jwt.secret키를 깃허브 시크릿에 저장 및 환경변수 설정 * feat: 환경변수 읽어오도록 수정 * feat: 도커를 사용하여 레디스 환경 구축
- Loading branch information
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Run Tests on Pull Request | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- Weekly | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
services: | ||
redis: | ||
image: redis:alpine | ||
ports: | ||
- 6379:6379 | ||
options: >- | ||
--health-cmd "redis-cli ping" | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up JDK | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: '21' | ||
distribution: 'temurin' | ||
|
||
- name: Run Tests | ||
env: | ||
JWT_SECRET: ${{ secrets.JWT_SECRET }} | ||
run: ./gradlew test |
7 changes: 7 additions & 0 deletions
7
src/test/java/com/example/sinitto/SinittoApplicationTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,20 @@ | ||
package com.example.sinitto; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
|
||
import static org.hibernate.validator.internal.util.Contracts.assertNotNull; | ||
|
||
@SpringBootTest | ||
class SinittoApplicationTests { | ||
|
||
@Value("${jwt.secret}") | ||
private String jwtSecret; | ||
|
||
@Test | ||
void contextLoads() { | ||
assertNotNull(jwtSecret); | ||
} | ||
|
||
} |