Skip to content
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
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Collector CI

on:
pull_request:
# 수집 워크플로가 수집 전에 같은 ref로 호출한다. 테스트가 깨진 코드로는 DB에 쓰지 않기 위해서다.
workflow_call:
inputs:
ref:
description: "테스트할 브랜치. 비우면 이벤트의 ref"
type: string
default: ""

permissions:
contents: read

jobs:
test:
name: Tests
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v6
with:
ref: ${{ inputs.ref }}
# 테스트용 Flyway가 fin-be 서브모듈의 마이그레이션 SQL로 스키마를 만든다.
submodules: true

- name: Set up Java 21
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: "21"

- name: Set up Gradle
uses: gradle/actions/setup-gradle@v6

- name: Run tests
run: bash ./gradlew test
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
public class ApiCollectorApplication {

public static void main(String[] args) {
SpringApplication.run(ApiCollectorApplication.class, args);
// 배치가 FAILED로 끝나면 0이 아닌 종료 코드를 내도록 한다(JobExecutionExitCodeGenerator). 수집 워크플로가 실패를 감지하는 근거.
System.exit(SpringApplication.exit(SpringApplication.run(ApiCollectorApplication.class, args)));
}

}
Loading