From 0671b2de91eeef59569f8d99b176fce3d69a16f5 Mon Sep 17 00:00:00 2001 From: Isak W Date: Tue, 16 Jun 2020 00:38:59 +0200 Subject: [PATCH] Add test coverage --- .github/workflows/ci.yml | 6 +++++- README.md | 1 + build.gradle.kts | 8 ++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3fb7945..9f1a727 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: - name: Set up environment uses: actions/setup-java@v1 with: - java-version: ${{java-version}} + java-version: ${{ matrix.java-version }} - name: Build with Gradle run: ./gradlew buildPlugin test: @@ -32,3 +32,7 @@ jobs: java-version: 11 - name: Test with Gradle run: ./gradlew test --info + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 + with: + file: build/reports/jacoco/test/jacocoTestReport.xml diff --git a/README.md b/README.md index b70abc3..a705294 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ This plugin adds an intention to open regular expressions on regex101.com [![Plugin downloads](https://img.shields.io/jetbrains/plugin/d/14461-open-regex101?style=flat-square)](https://plugins.jetbrains.com/plugin/14461-open-regex101) [![Plugin stars](https://img.shields.io/jetbrains/plugin/r/stars/14461-open-regex101?style=flat-square)](https://plugins.jetbrains.com/plugin/14461-open-regex101) [![Build status](https://img.shields.io/github/workflow/status/aesy/regex101-intellij/Continous%20Integration?style=flat-square)](https://github.com/aesy/regex101-intellij/actions) +[![Test coverage](https://img.shields.io/codecov/c/github/aesy/regex101-intellij?style=flat-square)](https://codecov.io/github/aesy/regex101-intellij) [![MIT license](https://img.shields.io/github/license/aesy/regex101-intellij.svg?style=flat-square)](https://github.com/aesy/regex101-intellij/blob/master/LICENSE) ## Installation diff --git a/build.gradle.kts b/build.gradle.kts index 27fe6be..235ebb1 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -2,6 +2,7 @@ import org.jetbrains.intellij.tasks.* import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { + jacoco kotlin("jvm") version "1.3.61" id("org.jetbrains.intellij") version "0.4.21" } @@ -30,6 +31,12 @@ intellij { } tasks { + jacocoTestReport { + reports { + xml.isEnabled = true + } + } + withType { gradleVersion = "6.5" } @@ -47,6 +54,7 @@ tasks { withType { useJUnitPlatform() + finalizedBy(jacocoTestReport) } withType {