-
Notifications
You must be signed in to change notification settings - Fork 0
119 lines (107 loc) · 3.77 KB
/
bbangzip_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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
name: BBANGZIP PR Builder
on:
pull_request:
branches: [ develop, main ]
defaults:
run:
shell: bash
working-directory: .
jobs:
build:
name: CI
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Gradle cache
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
- name: Change gradlew permissions
run: chmod +x ./gradlew
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Touch local properties
run: touch local.properties
- name: Access local properties
env:
BASE_URL: ${{ secrets.BASE_URL }}
KAKAO_NATIVE_APP_KEY: ${{ secrets.KAKAO_NATIVE_APP_KEY }}
run: |
echo "base.url=\"$BASE_URL\"" >> local.properties
echo "kakao.native.app.key=\"$KAKAO_NATIVE_APP_KEY\"" >> local.properties
- name: Lint Check
run: ./gradlew ktlintCheck -PcompileSdkVersion=34
- name: Build with Gradle
run: ./gradlew build -PcompileSdkVersion=34
- name: Discord Notify - PR Success
if: ${{ success() }}
uses: Ilshidur/[email protected]
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
DISCORD_USERNAME: BBANGZIP_BOT
DISCORD_EMBEDS: |
[
{
"author": {
"name": "${{ github.event.pull_request.user.login }}",
"icon_url": "${{ github.event.pull_request.user.avatar_url }}"
},
"title": "🍞 PR 성공! 코드리뷰 달아주셔~ 🍞\n#${{ github.event.pull_request.number }} : ${{ github.event.pull_request.title }}",
"color": 10478271,
"description": "${{ github.event.pull_request.html_url }}",
"fields": [
{
"name": "Base Branch",
"value": "${{ github.base_ref }}",
"inline": true
},
{
"name": "Compare Branch",
"value": "${{ github.head_ref }}",
"inline": true
}
]
}
]
- name: Discord Notify - PR Failure
if: ${{ failure() }}
uses: Ilshidur/[email protected]
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
DISCORD_USERNAME: BBANGZIP_BOT
DISCORD_EMBEDS: |
[
{
"author": {
"name": "${{ github.event.pull_request.user.login }}",
"url": "https://github.com/pknu-wap/WAPP/blob/main/image/icon.png?raw=true",
"icon_url": "${{ github.event.pull_request.user.avatar_url }}"
},
"title": "❌ PR 실패😭 에러 확인해줘! ❌\n#${{ github.event.pull_request.number }} : ${{ github.event.pull_request.title }}",
"color": 13458524,
"description": "${{ github.event.pull_request.html_url }}",
"fields": [
{
"name": "Base Branch",
"value": "${{ github.base_ref }}",
"inline": true
},
{
"name": "Compare Branch",
"value": "${{ github.head_ref }}",
"inline": true
}
]
}
]