Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '17.0.8+101'
java-version: '17'
cache: 'gradle'

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

- name: Build with Gradle
run: ./gradlew build --no-daemon
run: ./gradlew githubWorkflowTest --no-daemon -i

- name: Run Test Coverage
run: ./gradlew jacocoTestReport
run: ./gradlew jacocoTestReport -i -PexecutionData='/home/runner/work/java-interview-coding/java-interview-coding/build/jacoco/jacocoTest.exec'

- name: Generate JaCoCo Badge
uses: cicirello/jacoco-badge-generator@v2
Expand Down
14 changes: 13 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ tasks.withType(Javadoc) {
options.encoding = 'UTF-8'
}

test {
tasks.withType(Test) {
testLogging {
events "passed", "skipped", "failed",
// "standardOut", // Uncomment to get all logs during tests execution
Expand All @@ -59,11 +59,17 @@ test {
}

finalizedBy jacocoTestReport // report is always generated after tests run
jacoco {
destinationFile = layout.buildDirectory.file('jacoco/jacocoTest.exec').get().asFile
classDumpDir = layout.buildDirectory.dir('jacoco/classpathdumps').get().asFile
}
}

jacocoTestReport {
reports {
csv.required = true
xml.required = true
html.outputLocation = layout.buildDirectory.dir('jacocoHtml')
}
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
Expand All @@ -75,3 +81,9 @@ jacocoTestReport {
}))
}
}

task githubWorkflowTest(type: Test) {
exclude '**/**AddMultithreadingTest.class'
exclude '**/**BlockingQueueTest.class'
exclude '**/**DeadlockTest.class'
}
2 changes: 0 additions & 2 deletions src/test/java/by/andd3dfx/multithreading/DeadlockTest.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package by.andd3dfx.multithreading;

import org.junit.Ignore;
import org.junit.Test;

import java.util.concurrent.CompletableFuture;
Expand All @@ -10,7 +9,6 @@

public class DeadlockTest {

@Ignore("Fail of Github CI build")
@Test
public void makeDeadlock() throws InterruptedException {
CompletableFuture<Void> future = CompletableFuture.supplyAsync(() -> {
Expand Down