From 01b95c87ff8e97f6d83ab467cf7794dac65960a4 Mon Sep 17 00:00:00 2001 From: Maxime Petit Date: Wed, 22 May 2024 09:49:14 +0200 Subject: [PATCH 1/5] ci: add JaCoCo code coverage check --- .github/workflows/pr.yml | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/pr.yml diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..9b1015c --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,40 @@ +name: Test & Coverage +on: + pull_request: + branches: + - '*' + +jobs: + test-and-coverage: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + + - name: Set up the Maven dependencies caching + uses: actions/cache@v3 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + + - name: Run tests + run: mvn --batch-mode --update-snapshots verify -Dgpg.skip=true -Ddependency-check.skip=true + + - name: Add coverage + uses: madrapps/jacoco-report@v1.6.1 + with: + paths: | + ${{ github.workspace }}/**/target/test-results/jacoco/jacoco.xml + token: ${{ secrets.GITHUB_TOKEN }} + title: '### :zap: Coverage report' + update-comment: true + min-coverage-overall: 80 + min-coverage-changed-files: 60 + continue-on-error: false From 29b6d47326928cbef2f37be6904747fc77067f54 Mon Sep 17 00:00:00 2001 From: Maxime Petit Date: Wed, 19 Jun 2024 12:34:20 +0200 Subject: [PATCH 2/5] chore: bump JaCoCo version to 0.8.12 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4f3839f..aac3603 100644 --- a/pom.xml +++ b/pom.xml @@ -16,7 +16,7 @@ 17 1.9.22 - 0.8.8 + 0.8.12 2.2.220 2.16.0 2.0 From f8b6ad186eea6fff0f61ce174982fc9810291a19 Mon Sep 17 00:00:00 2001 From: Maxime Petit Date: Wed, 19 Jun 2024 12:43:55 +0200 Subject: [PATCH 3/5] fix: update JaCoCo code coverage path --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 9b1015c..1558247 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -31,7 +31,7 @@ jobs: uses: madrapps/jacoco-report@v1.6.1 with: paths: | - ${{ github.workspace }}/**/target/test-results/jacoco/jacoco.xml + ${{ github.workspace }}/target/test-results/coverage/jacoco/jacoco.xml token: ${{ secrets.GITHUB_TOKEN }} title: '### :zap: Coverage report' update-comment: true From 912614de36ad33284c00aaab34f57a8de42d2ef9 Mon Sep 17 00:00:00 2001 From: Maxime Petit Date: Thu, 20 Jun 2024 14:27:10 +0200 Subject: [PATCH 4/5] feat: update JaCoCo code coverage min value --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 1558247..1587c25 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -36,5 +36,5 @@ jobs: title: '### :zap: Coverage report' update-comment: true min-coverage-overall: 80 - min-coverage-changed-files: 60 + min-coverage-changed-files: 75 continue-on-error: false From db81374f48397eeb9b74b7198ad4e736650dcdde Mon Sep 17 00:00:00 2001 From: Maxime Petit Date: Thu, 20 Jun 2024 14:27:55 +0200 Subject: [PATCH 5/5] ci: remove circleci --- .circleci/config.yml | 40 ---------------------------------------- codecov.yml | 6 ------ 2 files changed, 46 deletions(-) delete mode 100644 .circleci/config.yml delete mode 100644 codecov.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 2438ce3..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,40 +0,0 @@ -version: 2.1 -orbs: - codecov: codecov/codecov@1.0.2 - -parameters: - jdk-image: - type: string - default: cimg/openjdk:17.0 - -jobs: - test: - environment: - MAVEN_OPTS: -Xmx3200m - docker: - - image: << pipeline.parameters.jdk-image >> - working_directory: ~/project - steps: - - checkout - - restore_cache: - keys: - - spring-search-{{ checksum "pom.xml" }} - - spring-search- - - run: mvn dependency:go-offline - - save_cache: - paths: - - ~/.m2 - key: spring-search-{{ checksum "pom.xml" }} - - run: mvn test - - store_artifacts: - path: ~/project/target/test-results - - codecov/upload: - file: ~/project/target/test-results/coverage/jacoco/jacoco.xml - flags: coverage - upload_name: Coverage - -workflows: - version: 2 - test: - jobs: - - test \ No newline at end of file diff --git a/codecov.yml b/codecov.yml deleted file mode 100644 index 3380cf9..0000000 --- a/codecov.yml +++ /dev/null @@ -1,6 +0,0 @@ -coverage: - status: - project: - default: - target: 80% - threshold: 1%