diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0b36f18ec..03d27cc7c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -65,10 +65,21 @@ jobs: with: java-version: 11 - # Run Gradle tests. + # Run Gradle build. - run: | chmod +x gradlew - ./gradlew test + ./gradlew build + + # Run Gradle tests. + - run: ./gradlew test + + # Generate Coverage Report. + - run: ./gradlew jacocoTestReport + + # Publish Coverage Report. + - uses: codecov/codecov-action@v1 + with: + file: ./photon-server/build/reports/jacoco/test/jacocoTestReport.xml build-package: needs: [build-client, build-server] diff --git a/README.md b/README.md index c5767cc1f..ccb28df63 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ # Photon Vision +[![CI](https://github.com/PhotonVision/photonvision/workflows/CI/badge.svg)](https://github.com/PhotonVision/photonvision/actions?query=workflow%3ACI) [![codecov](https://codecov.io/gh/PhotonVision/photonvision/branch/master/graph/badge.svg)](https://codecov.io/gh/PhotonVision/photonvision) + + This is fork of [Chameleon Vision](https://github.com/Chameleon-Vision/chameleon-vision/), a free open-source software for FRC teams to use for vision processing on their robots. Thank you to everyone who worked on the original project. For information on contributing or running PhotonVision, please read our documentation on ReadTheDocs. diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 000000000..66c42bd18 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,5 @@ +coverage: + # Turning off commit status to prevent failed checks if coverage decreases + status: + project: no + patch: no diff --git a/photon-server/.gitignore b/photon-server/.gitignore index 99d5d6b8e..590546a49 100644 --- a/photon-server/.gitignore +++ b/photon-server/.gitignore @@ -3,7 +3,7 @@ bin/* .project .classpath *.prefs -chameleon-vision +photonvision .gradle .gradle/* build diff --git a/photon-server/build.gradle b/photon-server/build.gradle index 7b852f196..580f71f0a 100644 --- a/photon-server/build.gradle +++ b/photon-server/build.gradle @@ -3,6 +3,7 @@ plugins { id 'com.github.johnrengelman.shadow' version '5.2.0' id "com.diffplug.gradle.spotless" version "3.28.0" id "application" + id "jacoco" } group 'org.photonvision' @@ -19,6 +20,7 @@ repositories { url = 'https://frcmaven.wpi.edu:443/artifactory/development' } } + ext { wpilibVersion = '2020.3.2-75-g1557a4c' openCVVersion = '3.4.7-2' @@ -124,3 +126,11 @@ spotless { licenseHeaderFile "$rootDir/LicenseHeader.txt" } } + +jacocoTestReport { + dependsOn test // Tests are required to run before generating the report + + reports { + xml.enabled true + } +}