-
Notifications
You must be signed in to change notification settings - Fork 1
84 lines (73 loc) · 2.55 KB
/
develop_pull_request.yml
File metadata and controls
84 lines (73 loc) · 2.55 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
name: develop pull request Check and Test
on:
pull_request:
branches: [ "develop" ]
jobs:
test:
runs-on: ubuntu-latest
env:
DB_NAME: ${{ secrets.DATABASE_NAME }}
DB_USERNAME: ${{ secrets.DATABASE_USERNAME }}
DB_PASSWORD: ${{ secrets.DATABASE_PASSWORD }}
strategy:
matrix:
java-version: [ 17 ]
distribution: [ 'temurin' ]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java-version }}
distribution: ${{ matrix.distribution }}
- name: Run MySQL with Docker
run: |
docker run -d \
--name mysql \
-e MYSQL_ROOT_PASSWORD=$DB_PASSWORD \
-e MYSQL_DATABASE=$DB_NAME \
-p 3306:3306 \
mysql:8.0
- name: Run Redis with Docker
run: |
docker run -d \
--name redis \
-p 6379:6379 \
redis:7.0
- name: Setup .env
run: |
echo "${{ secrets.TEST_ENV }}" >> .env
- name: Grant Execute Permission for Gradlew
run: chmod +x ./gradlew
- name: Run Gradle Check
run: ./gradlew check
# 슬랙으로 알림 전송
- name: Send to slack notification
uses: slackapi/slack-github-action@v2.1.0
with:
method: chat.postMessage
token: ${{ secrets.SLACK_BOT_TOKEN }}
payload: |
channel: ${{ secrets.SLACK_CHANNEL_ID }}
text: "PR event"
blocks:
- type: section
text:
type: mrkdwn
text: "${{ secrets.SLACK_GROUP_MENTION }}\n\n📌 *PR 이벤트 알림 (<${{ github.event.pull_request.html_url }}|#${{ github.event.pull_request.number }}>)*"
- type: section
text:
type: mrkdwn
text: "> PR 이벤트 알림입니다.\n> *최신 변경 사항 검토*, *코드 리뷰* 부탁드립니다."
- type: section
text:
type: mrkdwn
text: "*PR:* 🔗 <${{ github.event.pull_request.html_url }}|${{ github.event.pull_request.title }}>"
- type: context
elements:
- type: mrkdwn
text: "*브랜치:* `${{ github.head_ref }}` -> `${{ github.base_ref }}`"
- type: mrkdwn
text: "*작성자:* ${{ github.event.pull_request.user.login }}"
- type: divider