diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..ab073b1 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,44 @@ +name: CI + +on: + pull_request: + branches: [dev, main] + push: + branches: [dev, main] + +# 같은 PR에 커밋을 연달아 푸시하면 이전 실행을 취소 (러너 시간 절약) +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + test: + runs-on: ubuntu-latest + timeout-minutes: 15 + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: '17' + + # Gradle 의존성·빌드 캐시 자동 관리 (두 번째 실행부터 빨라짐) + - name: Set up Gradle + uses: gradle/actions/setup-gradle@v4 + + - name: Run tests + run: ./gradlew test + # ubuntu-latest 러너는 Docker 기본 탑재 → Testcontainers E2E가 그대로 동작 + + # 실패 시 테스트 리포트를 아티팩트로 업로드 (Actions 탭에서 다운로드해 원인 확인) + - name: Upload test report + if: failure() + uses: actions/upload-artifact@v4 + with: + name: test-report + path: build/reports/tests/test/ + retention-days: 7 \ No newline at end of file