Skip to content

Commit

Permalink
Infra: GitAction yml 작성
Browse files Browse the repository at this point in the history
part of swm-106
related to: #110
  • Loading branch information
adorableco committed Aug 1, 2024
1 parent 2ac5d01 commit 42df8ef
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 2 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/test-automation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: test-automation

on:
push:
branches:
- 'develop'
pull_request:
branches:
- 'develop'

permissions: write-all

jobs:
code-coverage:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: Set up properties
run: |
cd src/main
mkdir resources
cd resources
touch application.properties
echo "${{ secrets.APPLICATION }}" > application.properties
cat application.properties
shell: bash

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

- name: Test with Gradle
run: ./gradlew clean build test jacocoTestReport

- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v1
if: ${{ always() }}
with:
files: build/test-results/**/*.xml
20 changes: 20 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,20 @@ plugins {
kotlin("plugin.jpa") version "1.9.24"
kotlin("jvm") version "1.9.24"
kotlin("plugin.spring") version "1.9.24"
id("jacoco")

// for querydsl
kotlin("kapt") version "1.7.10"
}

subprojects {
apply(plugin = "jacoco")

jacoco {
toolVersion = "0.8.6"
}
}

val queryDslVersion: String by extra

group = "com.swm-standard"
Expand Down Expand Up @@ -127,3 +137,13 @@ tasks.named("clean") {
kapt {
generateStubs = true
}

tasks.jacocoTestReport {
reports {
html.required.set(false)
xml.required.set(true)
csv.required.set(false)

xml.outputLocation = file(project.layout.buildDirectory.dir("jacoco/index.xml"))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@ class WorkbookService(
.findById(questionId)
.getOrElse { throw NotFoundException(fieldName = "question", message = "id 를 재확인해주세요.") }

if (questionSetRepository
.existsByQuestionIdAndWorkbookId(questionId, workbook.id)
if (questionSetRepository.existsByQuestionIdAndWorkbookId(questionId, workbook.id)
) {
throw AlreadyExistedException("questionId ($questionId)")
}
Expand Down

0 comments on commit 42df8ef

Please sign in to comment.