From fe37590225a268b4769e2e27a3488255ea7c57f3 Mon Sep 17 00:00:00 2001 From: Maduranga Siriwardena Date: Fri, 13 Sep 2024 19:48:26 +0530 Subject: [PATCH] Build the source before uploading the report --- .github/workflows/coverage-generator.yml | 60 +++++++++++++++++++++--- codecov.yml | 12 +---- 2 files changed, 54 insertions(+), 18 deletions(-) diff --git a/.github/workflows/coverage-generator.yml b/.github/workflows/coverage-generator.yml index 50d950198b..401216189c 100644 --- a/.github/workflows/coverage-generator.yml +++ b/.github/workflows/coverage-generator.yml @@ -4,12 +4,41 @@ on: workflow_dispatch: jobs: - oidc-conformance-report: + build-source: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 + + - name: Set up Adopt JDK 11 + uses: actions/setup-java@v4 + with: + java-version: 11 + distribution: "adopt" + + - name: Build with Maven + run: | + mvn clean install -U -B -Dmaven.test.skip=true + + - name: Cache source code + uses: actions/cache@v4 + with: + path: . + key: ${{ runner.os }}-source-${{ github.sha }} + + oidc-conformance-report: + needs: build-source + runs-on: ubuntu-latest + + steps: + - name: Restore source code + uses: actions/cache@v4 + with: + path: . + key: ${{ runner.os }}-source-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-source- - name: Get the latest artifact URL for OIDC id: get-artifact-url-oidc @@ -47,7 +76,8 @@ jobs: ${{ steps.get-artifact-url-oidc.outputs.artifact-url }} - name: Unzip artifact for OIDC - run: unzip artifact-oidc.zip -d ./artifacts-oidc + run: | + unzip artifact-oidc.zip -d ./artifacts-oidc - name: Upload coverage reports to Codecov for OIDC uses: codecov/codecov-action@v4 @@ -58,11 +88,17 @@ jobs: disable_search: true fapi-conformance-report: + needs: build-source runs-on: ubuntu-latest steps: - - name: Checkout repository - uses: actions/checkout@v2 + - name: Restore source code + uses: actions/cache@v4 + with: + path: . + key: ${{ runner.os }}-source-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-source- - name: Get the latest artifact URL for FAPI id: get-artifact-url-fapi @@ -100,7 +136,8 @@ jobs: ${{ steps.get-artifact-url-fapi.outputs.artifact-url }} - name: Unzip artifact for FAPI - run: unzip artifact-fapi.zip -d ./artifacts-fapi + run: | + unzip artifact-fapi.zip -d ./artifacts-fapi - name: Upload coverage reports to Codecov for FAPI uses: codecov/codecov-action@v4 @@ -111,9 +148,18 @@ jobs: disable_search: true integration-test-report: + needs: build-source runs-on: ubuntu-latest steps: + - name: Restore source code + uses: actions/cache@v4 + with: + path: . + key: ${{ runner.os }}-source-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-source- + - name: Download integration Jacoco XML report run: | mkdir artifacts-integration @@ -125,4 +171,4 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} files: ./artifacts-integration/jacoco.xml flags: integration - disable_search: true \ No newline at end of file + disable_search: true diff --git a/codecov.yml b/codecov.yml index acfb58c17c..843a42781f 100644 --- a/codecov.yml +++ b/codecov.yml @@ -2,17 +2,7 @@ codecov: require_ci_to_pass: yes notify: wait_for_ci: yes -#coverage: -# status: -# project: -# default: -# enabled: yes -# threshold: null -# target: auto -# patch: -# default: -# target: 80% -# threshold: 40% + max_report_age: false coverage: status: