From ec02e8128b181aab26a4e74752266461764f7238 Mon Sep 17 00:00:00 2001 From: takumi-saito Date: Fri, 14 Apr 2023 05:20:34 +0900 Subject: [PATCH 01/20] Add use case logic, but exclude unit testing. --- app/src/main/java/com/kireaji/utsampleapp/AddItemUseCase.kt | 4 ++++ app/src/main/java/com/kireaji/utsampleapp/ItemRepository.kt | 1 + 2 files changed, 5 insertions(+) diff --git a/app/src/main/java/com/kireaji/utsampleapp/AddItemUseCase.kt b/app/src/main/java/com/kireaji/utsampleapp/AddItemUseCase.kt index d2c5ddf..eba42b5 100644 --- a/app/src/main/java/com/kireaji/utsampleapp/AddItemUseCase.kt +++ b/app/src/main/java/com/kireaji/utsampleapp/AddItemUseCase.kt @@ -4,4 +4,8 @@ class AddItemUseCase(private val itemRepository: ItemRepository) { fun execute(item: String): List { return itemRepository.addItem(item) } + + fun execute(items: List): List { + return itemRepository.addAllItems(items) + } } diff --git a/app/src/main/java/com/kireaji/utsampleapp/ItemRepository.kt b/app/src/main/java/com/kireaji/utsampleapp/ItemRepository.kt index e78e0ef..b531f0f 100644 --- a/app/src/main/java/com/kireaji/utsampleapp/ItemRepository.kt +++ b/app/src/main/java/com/kireaji/utsampleapp/ItemRepository.kt @@ -2,6 +2,7 @@ package com.kireaji.utsampleapp interface ItemRepository { fun addItem(item: String): List + fun addAllItems(items: List): List fun removeItem(item: String): List fun findItem(item: String): String? } From bebb733578b168ba7fa33430dee00e48e7fe7eb1 Mon Sep 17 00:00:00 2001 From: kireaji_plus_1 Date: Fri, 14 Apr 2023 05:34:30 +0900 Subject: [PATCH 02/20] Update android_ci.yml --- .github/workflows/android_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/android_ci.yml b/.github/workflows/android_ci.yml index 3997dfe..ed03aac 100644 --- a/.github/workflows/android_ci.yml +++ b/.github/workflows/android_ci.yml @@ -35,7 +35,7 @@ jobs: - name: Check coverage run: | min_coverage=80 - actual_coverage=$(grep -oP '(?<=total=")[0-9]*\.[0-9]*(?=%")' app/build/reports/jacoco/jacocoTestReport/html/index.xml) + actual_coverage=$(grep -oP '(?<=total=")[0-9]*\.[0-9]*(?=%")' app/build/reports/jacocoTestReport/html/index.html) is_less=$(echo "$actual_coverage < $min_coverage" | bc) if [ $is_less -eq 1 ]; then echo "error: coverage ($actual_coverage%) is below the minimum required ($min_coverage%)" From 3544fe5b9a736e8128221e1664d03974c08220fe Mon Sep 17 00:00:00 2001 From: kireaji_plus_1 Date: Fri, 14 Apr 2023 05:45:22 +0900 Subject: [PATCH 03/20] Update android_ci.yml --- .github/workflows/android_ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/android_ci.yml b/.github/workflows/android_ci.yml index ed03aac..5042353 100644 --- a/.github/workflows/android_ci.yml +++ b/.github/workflows/android_ci.yml @@ -34,9 +34,13 @@ jobs: - name: Check coverage run: | + echo "start" min_coverage=80 + echo "min_coverage:$min_coverage" actual_coverage=$(grep -oP '(?<=total=")[0-9]*\.[0-9]*(?=%")' app/build/reports/jacocoTestReport/html/index.html) + echo "actual_coverage:$actual_coverage" is_less=$(echo "$actual_coverage < $min_coverage" | bc) + echo "is_less:$is_less" if [ $is_less -eq 1 ]; then echo "error: coverage ($actual_coverage%) is below the minimum required ($min_coverage%)" exit 1 @@ -44,3 +48,4 @@ jobs: echo "success: coverage ($actual_coverage%) is above the minimum required ($min_coverage%)" fi + echo "end" From 19629419558c7f7372199491410b078946067643 Mon Sep 17 00:00:00 2001 From: kireaji_plus_1 Date: Fri, 14 Apr 2023 22:10:29 +0900 Subject: [PATCH 04/20] Update android_ci.yml --- .github/workflows/android_ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/android_ci.yml b/.github/workflows/android_ci.yml index 5042353..c642ef3 100644 --- a/.github/workflows/android_ci.yml +++ b/.github/workflows/android_ci.yml @@ -49,3 +49,6 @@ jobs: fi echo "end" + - name: Debug + if: ${{ always() }} + uses: mxschmitt/action-tmate@v3 From a1693582b94493e8908e1d204e1500b9931dcb10 Mon Sep 17 00:00:00 2001 From: kireaji_plus_1 Date: Sat, 15 Apr 2023 01:42:35 +0900 Subject: [PATCH 05/20] Update android_ci.yml --- .github/workflows/android_ci.yml | 48 +++++++++++++++++++------------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/.github/workflows/android_ci.yml b/.github/workflows/android_ci.yml index c642ef3..ce85e21 100644 --- a/.github/workflows/android_ci.yml +++ b/.github/workflows/android_ci.yml @@ -32,23 +32,31 @@ jobs: - name: Generate coverage report run: ./gradlew jacocoTestReport - - name: Check coverage - run: | - echo "start" - min_coverage=80 - echo "min_coverage:$min_coverage" - actual_coverage=$(grep -oP '(?<=total=")[0-9]*\.[0-9]*(?=%")' app/build/reports/jacocoTestReport/html/index.html) - echo "actual_coverage:$actual_coverage" - is_less=$(echo "$actual_coverage < $min_coverage" | bc) - echo "is_less:$is_less" - if [ $is_less -eq 1 ]; then - echo "error: coverage ($actual_coverage%) is below the minimum required ($min_coverage%)" - exit 1 - else - echo "success: coverage ($actual_coverage%) is above the minimum required ($min_coverage%)" - fi - - echo "end" - - name: Debug - if: ${{ always() }} - uses: mxschmitt/action-tmate@v3 +# - name: Check coverage +# run: | +# echo "start" +# min_coverage=80 +# echo "min_coverage:$min_coverage" +# actual_coverage=$(grep -oP '(?<=total=")[0-9]*\.[0-9]*(?=%")' app/build/reports/jacocoTestReport/html/index.html) +# echo "actual_coverage:$actual_coverage" +# is_less=$(echo "$actual_coverage < $min_coverage" | bc) +# echo "is_less:$is_less" +# if [ $is_less -eq 1 ]; then +# echo "error: coverage ($actual_coverage%) is below the minimum required ($min_coverage%)" +# exit 1 +# else +# echo "success: coverage ($actual_coverage%) is above the minimum required ($min_coverage%)" +# fi + +# echo "end" + - name: Add coverage to PR + id: jacoco + uses: madrapps/jacoco-report@v1.3 + with: + paths: ${{ github.workspace }}/build/reports/jacoco/jacocoTestReport/xml/jacocoTestReport.xml + token: ${{ secrets.GITHUB_TOKEN }} + min-coverage-overall: 40 + min-coverage-changed-files: 60 +# - name: Debug +# if: ${{ always() }} +# uses: mxschmitt/action-tmate@v3 From 73a91c773df459ed6c652e1a98fec063911bb9b8 Mon Sep 17 00:00:00 2001 From: kireaji_plus_1 Date: Sat, 15 Apr 2023 01:47:02 +0900 Subject: [PATCH 06/20] Update android_ci.yml --- .github/workflows/android_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/android_ci.yml b/.github/workflows/android_ci.yml index ce85e21..ccd9ae6 100644 --- a/.github/workflows/android_ci.yml +++ b/.github/workflows/android_ci.yml @@ -53,7 +53,7 @@ jobs: id: jacoco uses: madrapps/jacoco-report@v1.3 with: - paths: ${{ github.workspace }}/build/reports/jacoco/jacocoTestReport/xml/jacocoTestReport.xml + paths: ${{ github.workspace }}/build/reports/jacocoTestReport/jacocoTestReport.xml token: ${{ secrets.GITHUB_TOKEN }} min-coverage-overall: 40 min-coverage-changed-files: 60 From b603e333ff013723451f400363cdaa2dbff18779 Mon Sep 17 00:00:00 2001 From: kireaji_plus_1 Date: Sat, 15 Apr 2023 01:51:33 +0900 Subject: [PATCH 07/20] Update android_ci.yml --- .github/workflows/android_ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/android_ci.yml b/.github/workflows/android_ci.yml index ccd9ae6..20e6602 100644 --- a/.github/workflows/android_ci.yml +++ b/.github/workflows/android_ci.yml @@ -57,6 +57,6 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} min-coverage-overall: 40 min-coverage-changed-files: 60 -# - name: Debug -# if: ${{ always() }} -# uses: mxschmitt/action-tmate@v3 + - name: Debug + if: ${{ always() }} + uses: mxschmitt/action-tmate@v3 From c62ff30f0aaf6e2c8d537da5ec17a7876357fc47 Mon Sep 17 00:00:00 2001 From: kireaji_plus_1 Date: Sat, 15 Apr 2023 01:58:55 +0900 Subject: [PATCH 08/20] Update android_ci.yml --- .github/workflows/android_ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/android_ci.yml b/.github/workflows/android_ci.yml index 20e6602..234f871 100644 --- a/.github/workflows/android_ci.yml +++ b/.github/workflows/android_ci.yml @@ -53,10 +53,10 @@ jobs: id: jacoco uses: madrapps/jacoco-report@v1.3 with: - paths: ${{ github.workspace }}/build/reports/jacocoTestReport/jacocoTestReport.xml + paths: ${{ github.workspace }}/app/build/reports/jacocoTestReport/jacocoTestReport.xml token: ${{ secrets.GITHUB_TOKEN }} min-coverage-overall: 40 min-coverage-changed-files: 60 - - name: Debug - if: ${{ always() }} - uses: mxschmitt/action-tmate@v3 +# - name: Debug +# if: ${{ always() }} +# uses: mxschmitt/action-tmate@v3 From 1b051140b53396060eda1f5805f9766b144232b3 Mon Sep 17 00:00:00 2001 From: takumi-saito Date: Sat, 15 Apr 2023 04:00:14 +0900 Subject: [PATCH 09/20] Add use case logic, but exclude unit testing. --- .../com/kireaji/utsampleapp/FindItemUseCase.kt | 14 +++++++++++++- .../java/com/kireaji/utsampleapp/ItemRepository.kt | 3 +++ .../com/kireaji/utsampleapp/AddItemUseCaseTest.kt | 4 ++-- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/kireaji/utsampleapp/FindItemUseCase.kt b/app/src/main/java/com/kireaji/utsampleapp/FindItemUseCase.kt index 4d18261..3143c71 100644 --- a/app/src/main/java/com/kireaji/utsampleapp/FindItemUseCase.kt +++ b/app/src/main/java/com/kireaji/utsampleapp/FindItemUseCase.kt @@ -1,7 +1,19 @@ package com.kireaji.utsampleapp class FindItemUseCase(private val itemRepository: ItemRepository) { - fun execute(item: String): String? { + fun findItem(item: String): String? { return itemRepository.findItem(item) } + + fun takeItems(): List { + return itemRepository.takeItems(3) + } + + fun firstItem(): String? { + return itemRepository.firstItem() + } + + fun lastItem(): String? { + return itemRepository.lastItem() + } } \ No newline at end of file diff --git a/app/src/main/java/com/kireaji/utsampleapp/ItemRepository.kt b/app/src/main/java/com/kireaji/utsampleapp/ItemRepository.kt index b531f0f..96efa44 100644 --- a/app/src/main/java/com/kireaji/utsampleapp/ItemRepository.kt +++ b/app/src/main/java/com/kireaji/utsampleapp/ItemRepository.kt @@ -5,4 +5,7 @@ interface ItemRepository { fun addAllItems(items: List): List fun removeItem(item: String): List fun findItem(item: String): String? + fun takeItems(take: Int): List + fun firstItem(): String? + fun lastItem(): String? } diff --git a/app/src/test/java/com/kireaji/utsampleapp/AddItemUseCaseTest.kt b/app/src/test/java/com/kireaji/utsampleapp/AddItemUseCaseTest.kt index 2edd963..968e3b7 100644 --- a/app/src/test/java/com/kireaji/utsampleapp/AddItemUseCaseTest.kt +++ b/app/src/test/java/com/kireaji/utsampleapp/AddItemUseCaseTest.kt @@ -45,7 +45,7 @@ class AddItemUseCaseTest { `when`(itemRepository.findItem(item)).thenReturn(item) val findItemUseCase = FindItemUseCase(itemRepository) - val result = findItemUseCase.execute(item) + val result = findItemUseCase.findItem(item) assertEquals(item, result) } @@ -57,7 +57,7 @@ class AddItemUseCaseTest { `when`(itemRepository.findItem(item)).thenReturn(null) val findItemUseCase = FindItemUseCase(itemRepository) - val result = findItemUseCase.execute(item) + val result = findItemUseCase.findItem(item) assertNull(result) } From 365da4b7ebf7eb9f7b8e460fc5e38211bed0c956 Mon Sep 17 00:00:00 2001 From: kireaji_plus_1 Date: Mon, 17 Apr 2023 02:50:03 +0900 Subject: [PATCH 10/20] Update android_ci.yml --- .github/workflows/android_ci.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/android_ci.yml b/.github/workflows/android_ci.yml index 234f871..8f49c44 100644 --- a/.github/workflows/android_ci.yml +++ b/.github/workflows/android_ci.yml @@ -51,12 +51,20 @@ jobs: # echo "end" - name: Add coverage to PR id: jacoco - uses: madrapps/jacoco-report@v1.3 + uses: takumi-saito/jacoco-report@v1.3 with: paths: ${{ github.workspace }}/app/build/reports/jacocoTestReport/jacocoTestReport.xml token: ${{ secrets.GITHUB_TOKEN }} min-coverage-overall: 40 min-coverage-changed-files: 60 +# - name: Add coverage to PR +# id: jacoco +# uses: madrapps/jacoco-report@v1.3 +# with: +# paths: ${{ github.workspace }}/app/build/reports/jacocoTestReport/jacocoTestReport.xml +# token: ${{ secrets.GITHUB_TOKEN }} +# min-coverage-overall: 40 +# min-coverage-changed-files: 60 # - name: Debug # if: ${{ always() }} # uses: mxschmitt/action-tmate@v3 From bb6424fbbefc702ced2a241367de2339652af665 Mon Sep 17 00:00:00 2001 From: kireaji_plus_1 Date: Tue, 18 Apr 2023 02:09:06 +0900 Subject: [PATCH 11/20] Update android_ci.yml --- .github/workflows/android_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/android_ci.yml b/.github/workflows/android_ci.yml index 8f49c44..6ecfa14 100644 --- a/.github/workflows/android_ci.yml +++ b/.github/workflows/android_ci.yml @@ -51,7 +51,7 @@ jobs: # echo "end" - name: Add coverage to PR id: jacoco - uses: takumi-saito/jacoco-report@v1.3 + uses: takumi-saito/jacoco-report@v1.4 with: paths: ${{ github.workspace }}/app/build/reports/jacocoTestReport/jacocoTestReport.xml token: ${{ secrets.GITHUB_TOKEN }} From c3fe42039f7625778212ba9cf0d78c593185d890 Mon Sep 17 00:00:00 2001 From: kireaji_plus_1 Date: Tue, 18 Apr 2023 03:29:00 +0900 Subject: [PATCH 12/20] Update android_ci.yml --- .github/workflows/android_ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/android_ci.yml b/.github/workflows/android_ci.yml index 6ecfa14..40b14ad 100644 --- a/.github/workflows/android_ci.yml +++ b/.github/workflows/android_ci.yml @@ -57,6 +57,7 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} min-coverage-overall: 40 min-coverage-changed-files: 60 + debug-mode: true # - name: Add coverage to PR # id: jacoco # uses: madrapps/jacoco-report@v1.3 From 317ad8d5e9dd22afa12e515357599d0c1ccad3dc Mon Sep 17 00:00:00 2001 From: kireaji_plus_1 Date: Tue, 18 Apr 2023 03:51:34 +0900 Subject: [PATCH 13/20] Update android_ci.yml --- .github/workflows/android_ci.yml | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/.github/workflows/android_ci.yml b/.github/workflows/android_ci.yml index 40b14ad..1bf7462 100644 --- a/.github/workflows/android_ci.yml +++ b/.github/workflows/android_ci.yml @@ -32,40 +32,12 @@ jobs: - name: Generate coverage report run: ./gradlew jacocoTestReport -# - name: Check coverage -# run: | -# echo "start" -# min_coverage=80 -# echo "min_coverage:$min_coverage" -# actual_coverage=$(grep -oP '(?<=total=")[0-9]*\.[0-9]*(?=%")' app/build/reports/jacocoTestReport/html/index.html) -# echo "actual_coverage:$actual_coverage" -# is_less=$(echo "$actual_coverage < $min_coverage" | bc) -# echo "is_less:$is_less" -# if [ $is_less -eq 1 ]; then -# echo "error: coverage ($actual_coverage%) is below the minimum required ($min_coverage%)" -# exit 1 -# else -# echo "success: coverage ($actual_coverage%) is above the minimum required ($min_coverage%)" -# fi - -# echo "end" - name: Add coverage to PR id: jacoco - uses: takumi-saito/jacoco-report@v1.4 + uses: takumi-saito/jacoco-report@v1.5 with: paths: ${{ github.workspace }}/app/build/reports/jacocoTestReport/jacocoTestReport.xml token: ${{ secrets.GITHUB_TOKEN }} min-coverage-overall: 40 min-coverage-changed-files: 60 debug-mode: true -# - name: Add coverage to PR -# id: jacoco -# uses: madrapps/jacoco-report@v1.3 -# with: -# paths: ${{ github.workspace }}/app/build/reports/jacocoTestReport/jacocoTestReport.xml -# token: ${{ secrets.GITHUB_TOKEN }} -# min-coverage-overall: 40 -# min-coverage-changed-files: 60 -# - name: Debug -# if: ${{ always() }} -# uses: mxschmitt/action-tmate@v3 From 8411b9f6f1ac00cf68ed299e6e707f39b2c64a33 Mon Sep 17 00:00:00 2001 From: takumi-saito Date: Tue, 18 Apr 2023 04:31:26 +0900 Subject: [PATCH 14/20] add repository impl --- .../kireaji/utsampleapp/FindItemUseCase.kt | 4 +- .../kireaji/utsampleapp/ItemRepositoryImpl.kt | 37 +++++++++++++++++++ .../com/kireaji/utsampleapp/MainActivity.kt | 18 +++++++++ 3 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 app/src/main/java/com/kireaji/utsampleapp/ItemRepositoryImpl.kt diff --git a/app/src/main/java/com/kireaji/utsampleapp/FindItemUseCase.kt b/app/src/main/java/com/kireaji/utsampleapp/FindItemUseCase.kt index 3143c71..4717e82 100644 --- a/app/src/main/java/com/kireaji/utsampleapp/FindItemUseCase.kt +++ b/app/src/main/java/com/kireaji/utsampleapp/FindItemUseCase.kt @@ -5,8 +5,8 @@ class FindItemUseCase(private val itemRepository: ItemRepository) { return itemRepository.findItem(item) } - fun takeItems(): List { - return itemRepository.takeItems(3) + fun takeItems(take: Int): List { + return itemRepository.takeItems(take) } fun firstItem(): String? { diff --git a/app/src/main/java/com/kireaji/utsampleapp/ItemRepositoryImpl.kt b/app/src/main/java/com/kireaji/utsampleapp/ItemRepositoryImpl.kt new file mode 100644 index 0000000..484f6a2 --- /dev/null +++ b/app/src/main/java/com/kireaji/utsampleapp/ItemRepositoryImpl.kt @@ -0,0 +1,37 @@ +package com.kireaji.utsampleapp + +class ItemRepositoryImpl: ItemRepository{ + + private val itemList: MutableList = mutableListOf() + + override fun addItem(item: String): List { + itemList.add(item) + return itemList + } + + override fun addAllItems(items: List): List { + itemList.addAll(items) + return itemList + } + + override fun removeItem(item: String): List { + itemList.remove(item) + return itemList + } + + override fun findItem(item: String): String? { + return itemList.find { it == item } + } + + override fun takeItems(take: Int): List { + return itemList.take(take) + } + + override fun firstItem(): String? { + return itemList.firstOrNull() + } + + override fun lastItem(): String? { + return itemList.lastOrNull() + } +} diff --git a/app/src/main/java/com/kireaji/utsampleapp/MainActivity.kt b/app/src/main/java/com/kireaji/utsampleapp/MainActivity.kt index a5673e0..83d3d06 100644 --- a/app/src/main/java/com/kireaji/utsampleapp/MainActivity.kt +++ b/app/src/main/java/com/kireaji/utsampleapp/MainActivity.kt @@ -2,10 +2,28 @@ package com.kireaji.utsampleapp import androidx.appcompat.app.AppCompatActivity import android.os.Bundle +import android.util.Log class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) + + val repository = ItemRepositoryImpl() + val findItemUseCase = FindItemUseCase(repository) + val addItemUseCase = AddItemUseCase(repository) + val removeItemUseCase = RemoveItemUseCase(repository) + + addItemUseCase.execute("item1") + addItemUseCase.execute(listOf( + "item2", + "item3", + )) + Log.d("test", "firstItem: ${findItemUseCase.firstItem()}") + Log.d("test", "findItem: ${findItemUseCase.findItem("item2")}") + Log.d("test", "lastItem: ${findItemUseCase.lastItem()}") + Log.d("test", "takeItems: ${findItemUseCase.takeItems(3)}") + removeItemUseCase.execute("item1") + Log.d("test", "takeItems: ${findItemUseCase.takeItems(3)}") } } \ No newline at end of file From 76ee10a6043d711b77c5d580afef53b32e176389 Mon Sep 17 00:00:00 2001 From: takumi-saito Date: Tue, 18 Apr 2023 04:50:08 +0900 Subject: [PATCH 15/20] update build.gradle --- app/build.gradle | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 7209cb3..0244161 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -60,8 +60,12 @@ task jacocoTestReport(type: JacocoReport, dependsOn: ['testDebugUnitTest']) { csv.enabled false } - def fileFilter = ['**/R.class', '**/R$*.class', '**/BuildConfig.*', '**/Manifest*.*', '**/*Test*.*', 'android/**/*.*'] - def debugTree = fileTree(dir: "$buildDir/tmp/kotlin-classes/debug", excludes: fileFilter) + def excludes = ['**/R.class', '**/R$*.class', '**/BuildConfig.*', '**/Manifest*.*', '**/*Test*.*', 'android/**/*.*'] + def debugTree = fileTree( + dir: "$buildDir/tmp/kotlin-classes/debug", + include: '**/*UseCase.*', + excludes: excludes + ) def mainSrc = "$project.projectDir/src/main/java" sourceDirectories.from = files([mainSrc]) From 1aaa9174a46f48aee27e91dda98ed4cbdc4e1b1e Mon Sep 17 00:00:00 2001 From: kireaji_plus_1 Date: Tue, 18 Apr 2023 05:05:10 +0900 Subject: [PATCH 16/20] Update android_ci.yml --- .github/workflows/android_ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/android_ci.yml b/.github/workflows/android_ci.yml index 1bf7462..68b8a9b 100644 --- a/.github/workflows/android_ci.yml +++ b/.github/workflows/android_ci.yml @@ -11,7 +11,8 @@ on: jobs: build: - runs-on: ubuntu-latest +# runs-on: ubuntu-latest + runs-on: self-hosted steps: - name: Checkout repository From 5c8c451239803ecb07dd1db723adf0e6852b7a9d Mon Sep 17 00:00:00 2001 From: kireaji_plus_1 Date: Wed, 19 Apr 2023 01:39:37 +0900 Subject: [PATCH 17/20] Update android_ci.yml --- .github/workflows/android_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/android_ci.yml b/.github/workflows/android_ci.yml index 68b8a9b..812d479 100644 --- a/.github/workflows/android_ci.yml +++ b/.github/workflows/android_ci.yml @@ -35,7 +35,7 @@ jobs: - name: Add coverage to PR id: jacoco - uses: takumi-saito/jacoco-report@v1.5 + uses: takumi-saito/jacoco-report@v1.6 with: paths: ${{ github.workspace }}/app/build/reports/jacocoTestReport/jacocoTestReport.xml token: ${{ secrets.GITHUB_TOKEN }} From 84f9ed9f8d830a7b89a8efa1744313162ffd7243 Mon Sep 17 00:00:00 2001 From: kireaji_plus_1 Date: Wed, 19 Apr 2023 05:37:43 +0900 Subject: [PATCH 18/20] Update android_ci.yml --- .github/workflows/android_ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/android_ci.yml b/.github/workflows/android_ci.yml index 812d479..4b417ba 100644 --- a/.github/workflows/android_ci.yml +++ b/.github/workflows/android_ci.yml @@ -41,4 +41,5 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} min-coverage-overall: 40 min-coverage-changed-files: 60 + merge-block: false debug-mode: true From 0a8eb59f438bcd216e56893b711b0c393c94145d Mon Sep 17 00:00:00 2001 From: kireaji_plus_1 Date: Wed, 19 Apr 2023 05:44:20 +0900 Subject: [PATCH 19/20] Update android_ci.yml --- .github/workflows/android_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/android_ci.yml b/.github/workflows/android_ci.yml index 4b417ba..4309347 100644 --- a/.github/workflows/android_ci.yml +++ b/.github/workflows/android_ci.yml @@ -35,7 +35,7 @@ jobs: - name: Add coverage to PR id: jacoco - uses: takumi-saito/jacoco-report@v1.6 + uses: takumi-saito/jacoco-report@v1.7 with: paths: ${{ github.workspace }}/app/build/reports/jacocoTestReport/jacocoTestReport.xml token: ${{ secrets.GITHUB_TOKEN }} From 3337696d203aef1a906a3d2c08149a9f6ac533e4 Mon Sep 17 00:00:00 2001 From: kireaji_plus_1 Date: Thu, 28 Mar 2024 03:23:23 +0900 Subject: [PATCH 20/20] Create README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..f8c9f24 --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +This is a sample of commenting a coverage report to PR using an Android app. + +- [Coverage report by Jacoco](https://github.com/takumi-saito/UTSampleApp/pull/4) +- [Coverage report by Kover](https://github.com/takumi-saito/UTSampleApp/pull/5)