From a41828cd581ab511cbba8a522d242526f481801f Mon Sep 17 00:00:00 2001 From: Nick Cross Date: Fri, 24 Nov 2023 09:12:58 +0000 Subject: [PATCH] Fix coverage --- .codecov.yml | 3 +- .github/workflows/codecov-main.yaml | 19 ------------- .github/workflows/go-ci.yaml | 6 ++-- .github/workflows/{build.yml => java-ci.yml} | 16 ++++++++--- .github/workflows/kube-linter.yaml | 3 +- .github/workflows/minikube.yaml | 2 +- java-components/pom.xml | 29 ++++++++++++++++++++ 7 files changed, 47 insertions(+), 31 deletions(-) delete mode 100644 .github/workflows/codecov-main.yaml rename .github/workflows/{build.yml => java-ci.yml} (50%) diff --git a/.codecov.yml b/.codecov.yml index 6eae8911b5..6d314a9e99 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -1,4 +1,3 @@ -comment: off coverage: status: project: @@ -6,7 +5,7 @@ coverage: target: auto threshold: 1% removed_code_behavior: adjust_base - patch: + patch: default: informational: true target: auto diff --git a/.github/workflows/codecov-main.yaml b/.github/workflows/codecov-main.yaml deleted file mode 100644 index 134c7a9a0f..0000000000 --- a/.github/workflows/codecov-main.yaml +++ /dev/null @@ -1,19 +0,0 @@ -name: Codecov report on push to the "main" branch -on: - push: - branches: [ main ] -jobs: - coverage: - name: Unit tests and coverage report - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v4 - with: - go-version-file: './go.mod' - - name: Build - run: make build - - name: Run tests - run: make test - - name: Codecov - uses: codecov/codecov-action@v3 diff --git a/.github/workflows/go-ci.yaml b/.github/workflows/go-ci.yaml index 791f547b0b..223a638dc4 100644 --- a/.github/workflows/go-ci.yaml +++ b/.github/workflows/go-ci.yaml @@ -1,4 +1,4 @@ -name: Validate PR - golang CI +name: GoLang CI on: pull_request: branches: [ main ] @@ -22,7 +22,7 @@ jobs: - name: Install Go uses: actions/setup-go@v4 with: - go-version: 1.19.x + go-version-file: './go.mod' - name: Check out code uses: actions/checkout@v4 - name: Check go mod status @@ -59,7 +59,7 @@ jobs: - name: Install Go uses: actions/setup-go@v4 with: - go-version: 1.19.x + go-version-file: './go.mod' - name: Check out code uses: actions/checkout@v4 - name: Build diff --git a/.github/workflows/build.yml b/.github/workflows/java-ci.yml similarity index 50% rename from .github/workflows/build.yml rename to .github/workflows/java-ci.yml index a8e03b767b..9b262840e0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/java-ci.yml @@ -1,14 +1,20 @@ name: Java CI -on: [push, pull_request] - +on: + pull_request: + branches: [ main ] jobs: build: - runs-on: ubuntu-latest - steps: - uses: actions/checkout@v4 + - name: Cache local Maven repository + uses: actions/cache@v3 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- - name: Set up JDK 17 uses: actions/setup-java@v3 with: @@ -17,3 +23,5 @@ jobs: - name: Build with Maven working-directory: java-components run: mvn -V -B package -Dvalidate-format + - name: Codecov + uses: codecov/codecov-action@v3 diff --git a/.github/workflows/kube-linter.yaml b/.github/workflows/kube-linter.yaml index 4b69b06d14..d243dd34b3 100644 --- a/.github/workflows/kube-linter.yaml +++ b/.github/workflows/kube-linter.yaml @@ -1,4 +1,4 @@ -name: Check Kubernetes YAMLs with kube-linter +name: Validate Kubernetes YAMLs on: pull_request: @@ -7,7 +7,6 @@ on: - 'deploy/crds/base/**.ya?ml' - 'deploy/operator/base/**.ya?ml' - 'deploy/operator/config/**.ya?ml' - jobs: kube-linter: name: Kube linter diff --git a/.github/workflows/minikube.yaml b/.github/workflows/minikube.yaml index 80a326d772..847c1bfbd3 100644 --- a/.github/workflows/minikube.yaml +++ b/.github/workflows/minikube.yaml @@ -1,4 +1,4 @@ -name: Validate PR - Minikube Tests +name: Minikube Tests on: pull_request: branches: [ main ] diff --git a/java-components/pom.xml b/java-components/pom.xml index 781f60c3e0..96a5cbc1d8 100644 --- a/java-components/pom.xml +++ b/java-components/pom.xml @@ -267,6 +267,14 @@ + + + io.quarkus + quarkus-jacoco + test + + + @@ -310,6 +318,27 @@ + + + + org.jacoco + jacoco-maven-plugin + 0.8.10 + + + default-prepare-agent + + prepare-agent + + + *QuarkusClassLoader + ${project.build.directory}/jacoco-quarkus.exec + true + + + + +