From 58aea7880ff7dc3edb8aa3027886aecfc7041fa7 Mon Sep 17 00:00:00 2001 From: Thomas Richner Date: Thu, 15 Feb 2024 17:45:25 +0100 Subject: [PATCH] ARC-1298: Don't run SONAR in forks --- .github/workflows/unit-tests.yml | 13 +++++++++++-- ehealthid-rp/pom.xml | 27 +++++++++++++++++++++++++++ ehealthid/pom.xml | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 70 insertions(+), 2 deletions(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 0d79f58..c3f3a54 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -22,14 +22,23 @@ jobs: java-version: 21 distribution: 'temurin' cache: 'maven' + - name: Run unit tests + run: ./mvnw -B verify - name: Cache SonarCloud packages + if: ${{ github.event.pull_request.head.repo.full_name == 'oviva-ag/ehealthid-relying-party' }} uses: actions/cache@v3 with: path: ~/.sonar/cache key: ${{ runner.os }}-sonar restore-keys: ${{ runner.os }}-sonar - - name: Run unit tests + - name: Check Coverage + if: ${{ github.event.pull_request.head.repo.full_name != 'oviva-ag/ehealthid-relying-party' }} + run: + - name: Run Sonar + if: ${{ github.event.pull_request.head.repo.full_name == 'oviva-ag/ehealthid-relying-party' }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: ./mvnw -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar + run: ./mvnw -B org.sonarsource.scanner.maven:sonar-maven-plugin:sonar + + diff --git a/ehealthid-rp/pom.xml b/ehealthid-rp/pom.xml index 607c3ec..e472dce 100644 --- a/ehealthid-rp/pom.xml +++ b/ehealthid-rp/pom.xml @@ -205,6 +205,33 @@ + + org.jacoco + jacoco-maven-plugin + + + check + verify + + check + + + + + BUNDLE + + + INSTRUCTION + COVEREDRATIO + 0.80 + + + + + + + + diff --git a/ehealthid/pom.xml b/ehealthid/pom.xml index 7411829..2492c69 100644 --- a/ehealthid/pom.xml +++ b/ehealthid/pom.xml @@ -112,4 +112,36 @@ + + + + org.jacoco + jacoco-maven-plugin + + + check + verify + + check + + + + + BUNDLE + + + INSTRUCTION + COVEREDRATIO + 0.80 + + + + + + + + + + +