Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy: PR 생성시 테스트코드 수행 로직 구현 #94

Merged
merged 4 commits into from
Oct 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/testcode.yml
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
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);
}

}
Loading