-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (80 loc) · 2.67 KB
/
ci.yml
File metadata and controls
96 lines (80 loc) · 2.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Continuous Integration
on:
pull_request:
branches: [ "develop" ]
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
type: choice
options:
- info
- warning
- debug
tags:
description: 'Test scenario tags'
required: false
type: boolean
environment:
description: 'Environment to run tests against'
type: environment
required: false
permissions:
contents: write
jobs:
develop-test:
runs-on: ubuntu-24.04
steps:
- name: Checkout PR
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
# 1. Node.js 설치 (AsyncAPI CLI 실행용)
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Clean old docs
run: rm -rf gotcha-socket/src/main/resources/static.docs gotcha-socket/src/main/resources/static/docs
# 3. AsyncAPI CLI 전역 설치 (최신 버전)
- name: Install AsyncAPI CLI
run: npm install -g @asyncapi/cli@latest
# 4. AsyncAPI → HTML 문서 자동 생성
- name: Generate HTML Docs
run: |
asyncapi generate fromTemplate gotcha-socket/asyncapi.yaml @asyncapi/html-template@3.0.0 --output gotcha-socket/src/main/resources/static/docs --use-new-generator
# 5. 문서 변경사항 커밋 & 푸시
- name: Commit and Push Generated Docs
run: |
git config --global user.name "github-actions"
git config --global user.email "actions@github.com"
git add gotcha-socket/src/main/resources/static/docs
if git diff --cached --quiet; then
echo "No changes to commit"
else
git commit -m "Auto-update AsyncAPI docs"
git push
fi
# 7. 자바 환경 설정
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
# 7. 테스트를 위한 DB 설정
- name: Setup MySQL
uses: mirromutth/mysql-action@v1.1
with:
mysql database: ${{ secrets.MYSQL_TEST_DATABASE }}
mysql user: ${{ secrets.MYSQL_TEST_USER }}
mysql password: ${{ secrets.MYSQL_TEST_PASSWORD }}
# 8. Gradlew 실행 권한 설정
- name: Run chmod to make gradlew executable
run: chmod +x ./gradlew
# 9. Gradle Test 실행
- name: Build with Gradle
uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25
with:
arguments: build -x test