-
Notifications
You must be signed in to change notification settings - Fork 1
150 lines (128 loc) · 4.29 KB
/
ci.yml
File metadata and controls
150 lines (128 loc) · 4.29 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
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
name: CI - PR to develop
on:
pull_request:
branches: [ develop ]
jobs:
build-and-test:
runs-on: [self-hosted, dev-runner]
steps:
- name: Checkout source code
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Grant execute permission for gradlew
run: chmod +x ./gradlew
- name: Generate application-dev.yml
run: |
mkdir -p src/main/resources
cat <<EOF > src/main/resources/application.yml
server:
port: 8080
security:
jwt:
token:
expire-length: ${{ secrets.JWT_EXPIRE_LENGTH }}
secret-key: ${{ secrets.JWT_SECRET_KEY }}
admin:
password: ${{ secrets.ADMIN_PASSWORD }}
cloud:
aws:
region:
static: ap-northeast-2
s3:
bucket: code-l-bucket
credentials:
access-key: ${{ secrets.DEV_S3_ACCESS_KEY }}
secret-key: ${{ secrets.DEV_S3_SECRET_KEY }}
management:
endpoints:
web:
exposure:
include: health, metrics, prometheus
metrics:
enable:
processor: false
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://codel-db.cbu0ugiswpor.ap-northeast-2.rds.amazonaws.com:3306/codel
username: ${{ secrets.DEV_RDS_USER_NAME }}
password: ${{ secrets.DEV_RDS_USER_PASSWORD }}
jpa:
open-in-view: false
hibernate:
ddl-auto: create
show-sql: true
database-platform: org.hibernate.dialect.MySQL8Dialect
discord:
webhook:
url: ${{ secrets.DEV_DISCORD_WEBHOOK_URL }}
springdoc:
override-with-generic-response: false
EOF
- name: Generate application.yml for test
run: |
mkdir -p src/test/resources
cat <<EOF > src/test/resources/application.yml
server:
port: 8080
security:
jwt:
token:
expire-length: 3600000
secret-key: dummy-secret-key-should-be-long-enough-123456
admin:
password: dummy-admin-password
cloud:
aws:
region:
static: ap-northeast-2
s3:
bucket: dummy-code-l-bucket
credentials:
access-key: dummy-access-key
secret-key: dummy-secret-key
management:
endpoints:
web:
exposure:
include: health, metrics, prometheus
metrics:
enable:
all: true
spring:
datasource:
driver-class-name: org.h2.Driver
url: jdbc:h2:mem:testdb;MODE=MySQL;DATABASE_TO_LOWER=TRUE;CASE_INSENSITIVE_IDENTIFIERS=TRUE;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
username: sa
password:
jpa:
open-in-view: false
hibernate:
ddl-auto: create-drop
show-sql: true
database-platform: org.hibernate.dialect.H2Dialect
flyway:
enabled: false
h2:
console:
enabled: true
springdoc:
override-with-generic-response: false
logging:
level:
org.hibernate.SQL: debug
org.hibernate.type.descriptor.sql.BasicBinder: trace
EOF
- name: Restore firebase-adminsdk.json
run: |
echo "$FIREBASE_CONFIG_JSON" > ./src/main/resources/code-l-b109b-firebase-adminsdk-fbsvc-8c4eb2e6f2.json
env:
FIREBASE_CONFIG_JSON: ${{ secrets.FIREBASE_CONFIG_JSON }}
- name: Build with Gradle
run: ./gradlew build
- name: Run tests
run: ./gradlew test