Skip to content

Commit

Permalink
Merge pull request #11 from What-s-Your-Plan/feat/#10
Browse files Browse the repository at this point in the history
Server Github Actions 작성
  • Loading branch information
KIMSEI1124 authored Sep 14, 2024
2 parents 77b920f + d652776 commit 03acdd5
Show file tree
Hide file tree
Showing 5 changed files with 156 additions and 3 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/application-calendar-server-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: 🧪 Calendar Server Tests on Pull Request

on:
pull_request:
branches:
- main
- dev

jobs:
project-test:
runs-on: ubuntu-latest

steps:
- name: 📦 Checkout repository
uses: actions/checkout@v4

- name: 🏗️ Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'

- name: 🎟️ Grant execute permission for gradlew
run: chmod +x gradlew

- name: 🧪 Spring Boot Test
run: ./gradlew clean application:wypl-calendar:test
40 changes: 40 additions & 0 deletions .github/workflows/application-image-server-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: 🧪 Image Server Tests on Pull Request

on:
pull_request:
branches:
- main
- dev

jobs:
project-test:
runs-on: ubuntu-latest

steps:
- name: 📦 Checkout repository
uses: actions/checkout@v4

- name: 🖼️ Install ImageMagick
run: sudo apt-get install -y imagemagick

- name: 🏗️ Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'

- name: 🎟️ Grant execute permission for gradlew
run: chmod +x gradlew

- name: 🧪 Spring Boot Test
run: ./gradlew clean application:wypl-image:test

- name: Add coverage to PR
id: jacoco
uses: madrapps/[email protected]
with:
title: 📄 Image Server Jacoco Coverage Report
paths: ${{ github.workspace }}/**/wypl-image/reports/jacoco/test/jacocoTestReport.xml
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-overall: 80
min-coverage-changed-files: 80
27 changes: 27 additions & 0 deletions .github/workflows/application-notification-server-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: 🧪 Notification Server Tests on Pull Request

on:
pull_request:
branches:
- main
- dev

jobs:
project-test:
runs-on: ubuntu-latest

steps:
- name: 📦 Checkout repository
uses: actions/checkout@v4

- name: 🏗️ Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'

- name: 🎟️ Grant execute permission for gradlew
run: chmod +x gradlew

- name: 🧪 Spring Boot Test
run: ./gradlew clean application:wypl-notification:test
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,7 @@ out/
magick

### API Docs ###
**/main/resources/static/swagger-ui/*.yaml
**/main/resources/static/swagger-ui/*.yaml

### macOS ###
.DS_Store
60 changes: 58 additions & 2 deletions application/wypl-image/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,63 @@ dependencies {
testImplementation('org.mockito:mockito-core')
}

// API Docs Start
/* Jacoco Start */
tasks.withType(JacocoReport).configureEach {
reports {
html.required.set(true)
xml.required.set(true)
html.outputLocation.set(file("reports/jacoco/index.xml"))
xml.outputLocation.set(file("reports/jacoco/test/jacocoTestReport.xml"))
}

classDirectories.setFrom(
files(classDirectories.files.collect {
fileTree(it) {
exclude(
"**/*Application*",
"**/*Configuration*",
"**/*Request*",
"**/*Response*",
"**/common/**",
"**/config/**",
"**/data/**",
"**/exception/**",
"**/properties/**"
)
}
})
)
}

tasks.jacocoTestCoverageVerification {
violationRules {
rule {
enabled = true
element = 'CLASS'

limit {
counter = 'LINE'
value = 'COVEREDRATIO'
minimum = 0.80D
}

excludes = [
"**/*Application*",
"**/*Configuration*",
"**/*Request*",
"**/*Response*",
"**/common/**",
"**/config/**",
"**/data/**",
"**/exception/**",
"**/properties/**"
]
}
}
}
/* Jacoco End */

/* API Docs Start */
openapi3 {
setServer("http://127.0.0.1:8080")
title = "What's Your Plan! Image Server API Docs"
Expand All @@ -42,4 +98,4 @@ tasks.register("copyOasToSwagger", Copy) {
from("build/api-spec/openapi3.yaml")
into("src/main/resources/static/swagger-ui/")
}
// API Docs End
/* API Docs End */

0 comments on commit 03acdd5

Please sign in to comment.