Skip to content

Commit 03acdd5

Browse files
authored
Merge pull request #11 from What-s-Your-Plan/feat/#10
Server Github Actions 작성
2 parents 77b920f + d652776 commit 03acdd5

5 files changed

+156
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: 🧪 Calendar Server Tests on Pull Request
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
- dev
8+
9+
jobs:
10+
project-test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: 📦 Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: 🏗️ Set up JDK 17
18+
uses: actions/setup-java@v4
19+
with:
20+
distribution: 'temurin'
21+
java-version: '17'
22+
23+
- name: 🎟️ Grant execute permission for gradlew
24+
run: chmod +x gradlew
25+
26+
- name: 🧪 Spring Boot Test
27+
run: ./gradlew clean application:wypl-calendar:test
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: 🧪 Image Server Tests on Pull Request
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
- dev
8+
9+
jobs:
10+
project-test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: 📦 Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: 🖼️ Install ImageMagick
18+
run: sudo apt-get install -y imagemagick
19+
20+
- name: 🏗️ Set up JDK 17
21+
uses: actions/setup-java@v4
22+
with:
23+
distribution: 'temurin'
24+
java-version: '17'
25+
26+
- name: 🎟️ Grant execute permission for gradlew
27+
run: chmod +x gradlew
28+
29+
- name: 🧪 Spring Boot Test
30+
run: ./gradlew clean application:wypl-image:test
31+
32+
- name: Add coverage to PR
33+
id: jacoco
34+
uses: madrapps/[email protected]
35+
with:
36+
title: 📄 Image Server Jacoco Coverage Report
37+
paths: ${{ github.workspace }}/**/wypl-image/reports/jacoco/test/jacocoTestReport.xml
38+
token: ${{ secrets.GITHUB_TOKEN }}
39+
min-coverage-overall: 80
40+
min-coverage-changed-files: 80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: 🧪 Notification Server Tests on Pull Request
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
- dev
8+
9+
jobs:
10+
project-test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: 📦 Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: 🏗️ Set up JDK 21
18+
uses: actions/setup-java@v4
19+
with:
20+
distribution: 'temurin'
21+
java-version: '21'
22+
23+
- name: 🎟️ Grant execute permission for gradlew
24+
run: chmod +x gradlew
25+
26+
- name: 🧪 Spring Boot Test
27+
run: ./gradlew clean application:wypl-notification:test

.gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,7 @@ out/
4545
magick
4646

4747
### API Docs ###
48-
**/main/resources/static/swagger-ui/*.yaml
48+
**/main/resources/static/swagger-ui/*.yaml
49+
50+
### macOS ###
51+
.DS_Store

application/wypl-image/build.gradle

+58-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,63 @@ dependencies {
2626
testImplementation('org.mockito:mockito-core')
2727
}
2828

29-
// API Docs Start
29+
/* Jacoco Start */
30+
tasks.withType(JacocoReport).configureEach {
31+
reports {
32+
html.required.set(true)
33+
xml.required.set(true)
34+
html.outputLocation.set(file("reports/jacoco/index.xml"))
35+
xml.outputLocation.set(file("reports/jacoco/test/jacocoTestReport.xml"))
36+
}
37+
38+
classDirectories.setFrom(
39+
files(classDirectories.files.collect {
40+
fileTree(it) {
41+
exclude(
42+
"**/*Application*",
43+
"**/*Configuration*",
44+
"**/*Request*",
45+
"**/*Response*",
46+
"**/common/**",
47+
"**/config/**",
48+
"**/data/**",
49+
"**/exception/**",
50+
"**/properties/**"
51+
)
52+
}
53+
})
54+
)
55+
}
56+
57+
tasks.jacocoTestCoverageVerification {
58+
violationRules {
59+
rule {
60+
enabled = true
61+
element = 'CLASS'
62+
63+
limit {
64+
counter = 'LINE'
65+
value = 'COVEREDRATIO'
66+
minimum = 0.80D
67+
}
68+
69+
excludes = [
70+
"**/*Application*",
71+
"**/*Configuration*",
72+
"**/*Request*",
73+
"**/*Response*",
74+
"**/common/**",
75+
"**/config/**",
76+
"**/data/**",
77+
"**/exception/**",
78+
"**/properties/**"
79+
]
80+
}
81+
}
82+
}
83+
/* Jacoco End */
84+
85+
/* API Docs Start */
3086
openapi3 {
3187
setServer("http://127.0.0.1:8080")
3288
title = "What's Your Plan! Image Server API Docs"
@@ -42,4 +98,4 @@ tasks.register("copyOasToSwagger", Copy) {
4298
from("build/api-spec/openapi3.yaml")
4399
into("src/main/resources/static/swagger-ui/")
44100
}
45-
// API Docs End
101+
/* API Docs End */

0 commit comments

Comments
 (0)