From 5888c691513e37b65d98a2ab10a5d32c43d51530 Mon Sep 17 00:00:00 2001 From: jonathan zollinger Date: Fri, 1 Mar 2024 16:56:19 -0700 Subject: [PATCH 1/5] chore: bump version to 0.0.9-SNAPSHOT --- README.md | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c0032df..85bc3cc 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ gradle projects. com.graqr threshr - 0.0.8 + 0.0.9-SNAPSHOT ``` #### Include as a Gradle dependency diff --git a/pom.xml b/pom.xml index 6f342ab..ac23ef0 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.${owner} threshr - 0.0.8 + 0.0.9-SNAPSHOT ${packaging} From d44bc199b3627c271036d13b382157ad7ec503cf Mon Sep 17 00:00:00 2001 From: Jonathan Zollinger Date: Mon, 4 Mar 2024 22:06:56 -0700 Subject: [PATCH 2/5] build: add jacoco and sonarcloud report --- .github/workflows/mvn-test_push_all.yml | 30 ------------ .github/workflows/test.yml | 35 ++++++++++++++ pom.xml | 62 +++++++++++++++++++++++++ 3 files changed, 97 insertions(+), 30 deletions(-) delete mode 100644 .github/workflows/mvn-test_push_all.yml create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/mvn-test_push_all.yml b/.github/workflows/mvn-test_push_all.yml deleted file mode 100644 index 1846725..0000000 --- a/.github/workflows/mvn-test_push_all.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Run Maven Tests - -on: - push: - -jobs: - test: - env: - THRESHR_KEY: ${{ secrets.THRESHR_KEY }} - THRESHR_CHANNEL: ${{ vars.THRESHR_CHANNEL }} - TEST_DATASOURCES_DEFAULT_URL: ${{ secrets.TEST_DATASOURCES_DEFAULT_URL }} - - environment: redsky api - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Set up JDK 17 - uses: actions/setup-java@v3 - with: - java-version: '17' - distribution: 'zulu' - cache: maven - - name: Package with Maven - run: mvn -B test --file pom.xml - - - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v3 - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..9d7925d --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,35 @@ +name: Run Maven Tests + +on: [push, pull_request] + +jobs: + test: + env: + THRESHR_KEY: ${{ secrets.THRESHR_KEY }} + THRESHR_CHANNEL: ${{ vars.THRESHR_CHANNEL }} + TEST_DATASOURCES_DEFAULT_URL: ${{ secrets.TEST_DATASOURCES_DEFAULT_URL }} + + environment: redsky api + runs-on: ubuntu-latest + steps: + # https://github.com/actions/virtual-environments/issues/709 + - name: "󰆴 Free disk space" + run: | + sudo rm -rf "/usr/local/share/boost" + sudo rm -rf "$AGENT_TOOLSDIRECTORY" + sudo apt-get clean + df -h + - name: " Checkout repository" + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: "󰬷 Set up JDK 17" + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + cache: maven + - name: "󰙨 test with maven" + run: mvn -B test --file pom.xml jacoco:report + - name: generate report + run: mvn sonar:sonar -Pcoverage diff --git a/pom.xml b/pom.xml index ac23ef0..53b3ed0 100644 --- a/pom.xml +++ b/pom.xml @@ -47,6 +47,11 @@ ch.qos.logback logback-classic + + org.jacoco + jacoco-maven-plugin + 0.8.11 + io.micronaut micronaut-http-client @@ -204,6 +209,63 @@ + + org.jacoco + jacoco-maven-plugin + 0.8.11 + + + prepare-agent + + prepare-agent + + + + report + + report + + + + XML + + + + + + + + coverage + + + + org.jacoco + jacoco-maven-plugin + 0.8.7 + + + prepare-agent + + prepare-agent + + + + report + + report + + + + XML + + + + + + + + + From 55e19d3bd4c32f726606dfe7892ab7ab740e3740 Mon Sep 17 00:00:00 2001 From: jonathan zollinger Date: Tue, 5 Mar 2024 15:23:55 -0700 Subject: [PATCH 3/5] fix(ci): add mvn sonar call's required properties Signed-off-by: jonathan zollinger --- .github/workflows/test.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9d7925d..f79c9f4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,6 +1,10 @@ name: Run Maven Tests -on: [push, pull_request] +on: + push: + branches: + - main + pull_request: jobs: test: @@ -8,6 +12,7 @@ jobs: THRESHR_KEY: ${{ secrets.THRESHR_KEY }} THRESHR_CHANNEL: ${{ vars.THRESHR_CHANNEL }} TEST_DATASOURCES_DEFAULT_URL: ${{ secrets.TEST_DATASOURCES_DEFAULT_URL }} + SONAR_TOKEN: ${{ SONAR_TOKEN }} environment: redsky api runs-on: ubuntu-latest @@ -31,5 +36,10 @@ jobs: cache: maven - name: "󰙨 test with maven" run: mvn -B test --file pom.xml jacoco:report - - name: generate report - run: mvn sonar:sonar -Pcoverage + - name: " SonarCloud Scan" + run: | + mvn sonar:sonar -Pcoverage \ + -Dsonar.token=$SONAR_TOKEN + -Dsonar.host.url=https://sonarcloud.io \ + -Dsonar.organization=graqr \ + -Dsonar.projectKey=Graqr_Threshr \ No newline at end of file From 20b35ec38816c285956669f6fc91d4b818dccecc Mon Sep 17 00:00:00 2001 From: jonathan zollinger Date: Tue, 5 Mar 2024 17:03:25 -0700 Subject: [PATCH 4/5] feature(docs): add sonarcloud badges Signed-off-by: jonathan zollinger --- README.md | 81 +++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 64 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 85bc3cc..54b5e6d 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,45 @@ +--- +Author: Jonathan Zollinger +Title: Threshr Main README +--- + Threshr - The Target Grocery Harvester -[![build badge]][build link] + [![GitHub code size in bytes]][download link] [![license]][license file] [![GitHub last commit]][commit history] [![GitHub commit activity]][commit frequency] +
+ + + SonarCloud + +
+ + [![Quality Gate Status]][Quality Gate Status link] +
    + +### Security +[![Security Rating]][Security Rating link] +[![Code Smells]][Code Smells Link] +[![Bugs]][Bugs link] +[![Coverage]][Coverage Link] +[![Vulnerabilities]][Vulnerabilities link] + +### Usability / Maintainability +[![Reliability Rating]][Reliability Rating link] +[![Duplicated Lines]][Duplicated Lines Link] +[![Lines of Code]][Lines of Code link] +[![Technical Debt]][Technical Debt link] + + +
+
+ + ## Summary @@ -75,29 +110,41 @@ ___ See our [contributing] doc before taking a whack at any [open issues]. Also be sure to read the [Testing README](src/test/groovy/com/graqr/threshr/README.md) for some tips and tricks. We'd love for you to work with us! - -[these instructions]:https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-apache-maven-registry - -[build badge]:https://img.shields.io/github/actions/workflow/status/Graqr/Threshr/mvn-test_push_all.yml?style=plastic&logo=github&label=Build&link=https%3A%2F%2Fgithub.com%2FGraqr%2FThreshr%2Factions%20build-status%20 - -[build link]:https://github.com/Graqr/Threshr/actions/workflows/mvn-package_pr,push_main.yml?query=branch%3Amain - + +[Bugs]:https://sonarcloud.io/api/project_badges/measure?project=Graqr_Threshr&metric=bugs +[BugsLink]:https://sonarcloud.io/summary/new_code?id=Graqr_Threshr [open issues]:https://github.com/Graqr/Threshr/issues"open-issues" - [contributing]:Contributing.md - [GitHub code size in bytes]:https://img.shields.io/github/languages/code-size/Graqr/Threshr?style=plastic%20project-size%20 - [download link]:https://github.com/Graqr/Threshr/archive/refs/heads/main.zip - [license]:https://img.shields.io/github/license/Graqr/Threshr?style=plastic"GPL-3-License" - [license file]:LICENSE - [GitHub last commit]:https://img.shields.io/github/last-commit/Graqr/Threshr/main?style=plastic%20most-recent-commit - [commit history]:https://github.com/Graqr/Threshr/commits/main - [GitHub commit activity]:https://img.shields.io/github/commit-activity/y/Graqr/Threshr?style=plastic"commit-frequency" - [commit frequency]:https://github.com/Graqr/Threshr/graphs/code-frequency + + +[Quality Gate Status]:https://sonarcloud.io/api/project_badges/measure?project=Graqr_Threshr&metric=alert_status +[Quality Gate Status link]:https://sonarcloud.io/summary/new_code?id=Graqr_Threshr +[Code Smells]:https://sonarcloud.io/api/project_badges/measure?project=Graqr_Threshr&metric=code_smells +[Code Smells Link]:https://sonarcloud.io/summary/new_code?id=Graqr_Threshr +[Coverage]:https://sonarcloud.io/api/project_badges/measure?project=Graqr_Threshr&metric=coverage +[Coverage Link]:https://sonarcloud.io/summary/new_code?id=Graqr_Threshr +[Duplicated Lines]:https://sonarcloud.io/api/project_badges/measure?project=Graqr_Threshr&metric=duplicated_lines_density +[Duplicated Lines Link]:https://sonarcloud.io/summary/new_code?id=Graqr_Threshr +[Reliability Rating]:https://sonarcloud.io/api/project_badges/measure?project=Graqr_Threshr&metric=reliability_rating +[Reliability Rating link]:https://sonarcloud.io/summary/new_code?id=Graqr_Threshr +[Vulnerabilities]:https://sonarcloud.io/api/project_badges/measure?project=Graqr_Threshr&metric=vulnerabilities +[Vulnerabilities link]:https://sonarcloud.io/summary/new_code?id=Graqr_Threshr +[Security Rating]:https://sonarcloud.io/api/project_badges/measure?project=Graqr_Threshr&metric=security_rating +[Security Rating link]:https://sonarcloud.io/summary/new_code?id=Graqr_Threshr +[Bugs]:https://sonarcloud.io/api/project_badges/measure?project=Graqr_Threshr&metric=bugs +[Bugs link]:https://sonarcloud.io/summary/new_code?id=Graqr_Threshr +[Lines of Code]:https://sonarcloud.io/api/project_badges/measure?project=Graqr_Threshr&metric=ncloc +[Lines of Code link]:https://sonarcloud.io/summary/new_code?id=Graqr_Threshr +[Technical Debt]:https://sonarcloud.io/api/project_badges/measure?project=Graqr_Threshr&metric=sqale_index +[Technical Debt link]:https://sonarcloud.io/summary/new_code?id=Graqr_Threshr + + +[these instructions]:https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-apache-maven-registry \ No newline at end of file From 6444b2d41df1e28b16875f49f144e982c679f6dd Mon Sep 17 00:00:00 2001 From: jonathan zollinger Date: Wed, 13 Mar 2024 12:37:40 -0600 Subject: [PATCH 5/5] chore: bump version to 0.0.9 --- README.md | 6 +++--- pom.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 54b5e6d..ca6ac3c 100644 --- a/README.md +++ b/README.md @@ -65,12 +65,12 @@ gradle projects. com.graqr threshr - 0.0.9-SNAPSHOT + 0.0.9 ``` #### Include as a Gradle dependency ```groovy -compile "com.graqr:threshr:0.0.8" +compile "com.graqr:threshr:0.0.9" ``` #### Environment Variables @@ -147,4 +147,4 @@ See our [contributing] doc before taking a whack at any [open issues]. Also be s [Technical Debt link]:https://sonarcloud.io/summary/new_code?id=Graqr_Threshr -[these instructions]:https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-apache-maven-registry \ No newline at end of file +[these instructions]:https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-apache-maven-registry diff --git a/pom.xml b/pom.xml index 53b3ed0..1eeaf04 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.${owner} threshr - 0.0.9-SNAPSHOT + 0.0.9 ${packaging}