From 3cb28d54e1ad390a3975072f53b8bf555f259895 Mon Sep 17 00:00:00 2001 From: dhruv Date: Thu, 22 Aug 2024 10:08:40 +0530 Subject: [PATCH 1/3] added build log and jacoco report generation/uploading Signed-off-by: dhruv --- .github/workflows/build.yaml | 26 +++++++++++++++++++++----- .github/workflows/pr-build.yaml | 2 +- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index b32bffb5b..a0d2772c1 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -69,13 +69,14 @@ jobs: ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_KEY }} ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_PASSPHRASE }} run: | - gradle -b galasa-managers-parent/build.gradle check publish \ + set -o pipefail + gradle -b galasa-managers-parent/build.gradle check publish --info \ -Dorg.gradle.jvmargs=-Xmx4096M \ -PsourceMaven=https://development.galasa.dev/${{ env.ARGO_APP_BRANCH }}/maven-repo/extensions \ -PcentralMaven=https://repo.maven.apache.org/maven2/ \ -PtargetMaven=${{github.workspace}}/repo \ -PjacocoEnabled=true \ - -PisMainOrRelease=true + -PisMainOrRelease=true 2>&1 | tee build.log - name: Build Managers source code if: github.event_name == 'workflow_dispatch' # Use the input values provided by the workflow dispatch. @@ -86,14 +87,29 @@ jobs: ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_KEY }} ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_PASSPHRASE }} run: | - gradle -b galasa-managers-parent/build.gradle check publish \ + set -o pipefail + gradle -b galasa-managers-parent/build.gradle check publish --info \ -Dorg.gradle.jvmargs=-Xmx4096M \ -PsourceMaven=https://development.galasa.dev/${{ env.ARGO_APP_BRANCH }}/maven-repo/extensions \ -PcentralMaven=https://repo.maven.apache.org/maven2/ \ -PtargetMaven=${{github.workspace}}/repo \ -PjacocoEnabled=${{ inputs.jacocoEnabled }} \ - -PisMainOrRelease=${{ inputs.isMainOrRelease }} - + -PisMainOrRelease=${{ inputs.isMainOrRelease }} 2>&1 | tee build.log + + - name: Upload Gradle Build Log + if: always() + uses: actions/upload-artifact@v4 + with: + name: gradle-build-log + path: build.log + + - name: Upload Jacoco Report + if: always() + uses: actions/upload-artifact@v4 + with: + name: jacoco-report + path: ${{github.workspace}}/galasa-managers-parent/build/reports/jacoco/jacocoMerge + - name: Login to Github Container Registry uses: docker/login-action@v3 with: diff --git a/.github/workflows/pr-build.yaml b/.github/workflows/pr-build.yaml index d5897bcb1..6283e35e6 100644 --- a/.github/workflows/pr-build.yaml +++ b/.github/workflows/pr-build.yaml @@ -30,7 +30,7 @@ jobs: - name: Build Managers source code run: | - gradle -b galasa-managers-parent/build.gradle check publish \ + gradle -b galasa-managers-parent/build.gradle check publish --info \ -Dorg.gradle.jvmargs=-Xmx4096M \ -PsourceMaven=https://development.galasa.dev/gh/maven-repo/extensions \ -PcentralMaven=https://repo.maven.apache.org/maven2/ \ From 551d1ca39e6d716fcb69424a164c929a1812b9c8 Mon Sep 17 00:00:00 2001 From: dhruv Date: Thu, 22 Aug 2024 16:59:17 +0530 Subject: [PATCH 2/3] made required changes Signed-off-by: dhruv --- .github/workflows/build.yaml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index a0d2772c1..e75d7261e 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -97,19 +97,22 @@ jobs: -PisMainOrRelease=${{ inputs.isMainOrRelease }} 2>&1 | tee build.log - name: Upload Gradle Build Log - if: always() + if: failure() uses: actions/upload-artifact@v4 with: name: gradle-build-log path: build.log + retention-days: 7 - name: Upload Jacoco Report - if: always() + if: failure() uses: actions/upload-artifact@v4 with: name: jacoco-report - path: ${{github.workspace}}/galasa-managers-parent/build/reports/jacoco/jacocoMerge - + path: ${{github.workspace}}/galasa-managers-parent/**/**/build/reports/**/*.html + retention-days: 7 + if-no-files-found: ignore + - name: Login to Github Container Registry uses: docker/login-action@v3 with: From 01c4270ed42e79a99ae97eda96cc84003bd6f4e2 Mon Sep 17 00:00:00 2001 From: dhruv Date: Thu, 22 Aug 2024 18:10:02 +0530 Subject: [PATCH 3/3] added changes to pr workflow Signed-off-by: dhruv --- .github/workflows/pr-build.yaml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-build.yaml b/.github/workflows/pr-build.yaml index 6283e35e6..83a4a1f83 100644 --- a/.github/workflows/pr-build.yaml +++ b/.github/workflows/pr-build.yaml @@ -30,11 +30,29 @@ jobs: - name: Build Managers source code run: | + set -o pipefail gradle -b galasa-managers-parent/build.gradle check publish --info \ -Dorg.gradle.jvmargs=-Xmx4096M \ -PsourceMaven=https://development.galasa.dev/gh/maven-repo/extensions \ -PcentralMaven=https://repo.maven.apache.org/maven2/ \ - -PtargetMaven=${{github.workspace}}/repo + -PtargetMaven=${{github.workspace}}/repo 2>&1 | tee build.log + + - name: Upload Gradle Build Log + if: failure() + uses: actions/upload-artifact@v4 + with: + name: gradle-build-log + path: build.log + retention-days: 7 + + - name: Upload Jacoco Report + if: failure() + uses: actions/upload-artifact@v4 + with: + name: jacoco-report + path: ${{github.workspace}}/galasa-managers-parent/**/**/build/reports/**/*.html + retention-days: 7 + if-no-files-found: ignore - name: Build Managers image for testing uses: docker/build-push-action@v5