-
Notifications
You must be signed in to change notification settings - Fork 5
95 lines (82 loc) · 2.57 KB
/
backend_dev_ci.yml
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
95
name: 🚛 Backend Dev CI
on:
pull_request:
types: [ opened, reopened, synchronize ]
branches:
- dev
jobs:
PATH_CHANGES:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
backend: ${{ steps.changes.outputs.backend }}
steps:
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
backend:
- 'backend/**'
BE_CI:
environment: dev
runs-on: ubuntu-latest
needs: PATH_CHANGES
if: ${{ needs.PATH_CHANGES.outputs.backend == 'true' }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: '21'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Test with Gradle
id: gradle_test
working-directory: backend
run: ./gradlew test
BE_SLACK_MESSAGE:
environment: dev
runs-on: ubuntu-latest
needs: BE_CI
if: ${{!cancelled() && needs.BE_CI.result != 'skipped'}}
env:
lilychoibb: ${{secrets.LILYCHOIBB_SLACK_ID}}
robinjoon: ${{secrets.ROBINJOON_SLACK_ID}}
brgndyy: ${{secrets.BRGNDYY_SLACK_ID}}
chosim-dvlpr: ${{secrets.CHOSIM_DVLPR_SLACK_ID}}
Minjoo522: ${{secrets.MINJOO522_SLACK_ID}}
alstn113: ${{secrets.ALSTN113_SLACK_ID}}
le2sky: ${{secrets.LE2SKY_SLACK_ID}}
Parkhanyoung: ${{secrets.PARKHANYOUNG_SLACK_ID}}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: Get teamMember
id: teamMember
run: |
echo "SENDER_SLACK_ID=${{ env[github.event.sender.login] }}" >> $GITHUB_ENV
- name: Slack mention
uses: slackapi/[email protected]
with:
channel-id: ${{ secrets.ISSUE_CHANNEL }}
payload: |
{
"text": "pr 테스트 결과",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "pr 테스트 ${{ needs.BE_CI.result }} \n • 링크: <${{ github.event.pull_request.html_url }}|${{ github.event.pull_request.title }}> \n • pr 담당자: <@${{ env.SENDER_SLACK_ID }}>"
}
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.BOT_TOKEN }}