From ca5fe3e8353affae4855f23c9ac46df24894e89f Mon Sep 17 00:00:00 2001 From: JuanfeSanahuja Date: Thu, 22 Jun 2023 18:33:44 +0200 Subject: [PATCH 1/5] CICD: comment test reports code #TASK-4464 --- .github/workflows/develop.yml | 6 +- .github/workflows/release.yml | 6 +- .github/workflows/task.yml | 6 +- .github/workflows/test-analysis.yml | 99 ++++++++++++++++------------- 4 files changed, 64 insertions(+), 53 deletions(-) diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index f5bdedf67..0c0a1f139 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -17,9 +17,9 @@ jobs: uses: ./.github/workflows/test-analysis.yml needs: build secrets: inherit - with: - report_context: development - report_dir: ${{ github.ref_name }}/cellbase/${{ github.sha }} +# with: +# report_context: development +# report_dir: ${{ github.ref_name }}/cellbase/${{ github.sha }} deploy-maven: uses: opencb/java-common-libs/.github/workflows/deploy-maven-repository-workflow.yml@release-4.6.x diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d84b955ed..af69470db 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,9 +16,9 @@ jobs: uses: ./.github/workflows/test-analysis.yml needs: build secrets: inherit - with: - report_context: xetabase - report_dir: cellbase +# with: +# report_context: xetabase +# report_dir: cellbase deploy-maven: uses: opencb/java-common-libs/.github/workflows/deploy-maven-repository-workflow.yml@release-4.6.x diff --git a/.github/workflows/task.yml b/.github/workflows/task.yml index 03a61e613..7018f4942 100644 --- a/.github/workflows/task.yml +++ b/.github/workflows/task.yml @@ -16,9 +16,9 @@ jobs: uses: ./.github/workflows/test-analysis.yml needs: build secrets: inherit - with: - report_context: development - report_dir: ${{ github.ref_name }}/cellbase/${{ github.sha }} +# with: +# report_context: development +# report_dir: ${{ github.ref_name }}/cellbase/${{ github.sha }} deploy-docker: uses: opencb/java-common-libs/.github/workflows/deploy-docker-hub-workflow.yml@release-4.6.x diff --git a/.github/workflows/test-analysis.yml b/.github/workflows/test-analysis.yml index 869398f86..3bb74e7eb 100644 --- a/.github/workflows/test-analysis.yml +++ b/.github/workflows/test-analysis.yml @@ -4,23 +4,23 @@ on: secrets: SONAR_TOKEN: required: true - SSH_TESTING_SERVER_HOST: - required: true - SSH_TESTING_SERVER_PORT: - required: true - SSH_TESTING_SERVER_USER: - required: true - SSH_TESTING_SERVER_PASSWORD: - required: true - inputs: - report_dir: - type: string - required: true - report_context: - type: string - required: true -env: - xb_version: "1.7.0" +# SSH_TESTING_SERVER_HOST: +# required: true +# SSH_TESTING_SERVER_PORT: +# required: true +# SSH_TESTING_SERVER_USER: +# required: true +# SSH_TESTING_SERVER_PASSWORD: +# required: true +# inputs: +# report_dir: +# type: string +# required: true +# report_context: +# type: string +# required: true +#env: +# xb_version: "1.7.0" jobs: test: name: Test and push Sonar analysis @@ -53,30 +53,41 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} run: mvn -B verify surefire-report:report -Dcheckstyle.skip org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=opencb_cellbase - - name: Upload result dir - uses: actions/upload-artifact@v3 - with: - name: workdir - path: "**/target/site" - publish-test: - name: Publish test results - runs-on: ubuntu-22.04 - needs: test - strategy: - matrix: - module: ["cellbase-core", "cellbase-app", "cellbase-client", "cellbase-lib", "cellbase-server"] - steps: - - name: Download result dir - uses: actions/download-artifact@v3 - with: - name: workdir - - name: Deploy unit tests web recursively to remote - uses: garygrossgarten/github-action-scp@release - with: - local: ${{ matrix.module }}/target/site - remote: /var/www/html/reports/${{ inputs.report_context }}/${{ env.xb_version }}/${{ inputs.report_dir }}/unit/${{ matrix.module }} - host: ${{ secrets.SSH_TESTING_SERVER_HOST}} - port: ${{ secrets.SSH_TESTING_SERVER_PORT}} - username: ${{ secrets.SSH_TESTING_SERVER_USER }} - password: ${{ secrets.SSH_TESTING_SERVER_PASSWORD }} - concurrency: 2 + - name: Publish Test Report + uses: scacap/action-surefire-report@v1 + ## Skip cancelled() + ## https://docs.github.com/en/actions/learn-github-actions/expressions#cancelled + if: success() || failure() + with: + check_name: "Surefire tests report" + report_paths: './**/surefire-reports/TEST-*.xml' + commit: '${{ github.sha }}' + fail_on_test_failures: true + +# - name: Upload result dir +# uses: actions/upload-artifact@v3 +# with: +# name: workdir +# path: "**/target/site" +# publish-test: +# name: Publish test results +# runs-on: ubuntu-22.04 +# needs: test +# strategy: +# matrix: +# module: ["cellbase-core", "cellbase-app", "cellbase-client", "cellbase-lib", "cellbase-server"] +# steps: +# - name: Download result dir +# uses: actions/download-artifact@v3 +# with: +# name: workdir +# - name: Deploy unit tests web recursively to remote +# uses: garygrossgarten/github-action-scp@release +# with: +# local: ${{ matrix.module }}/target/site +# remote: /var/www/html/reports/${{ inputs.report_context }}/${{ env.xb_version }}/${{ inputs.report_dir }}/unit/${{ matrix.module }} +# host: ${{ secrets.SSH_TESTING_SERVER_HOST}} +# port: ${{ secrets.SSH_TESTING_SERVER_PORT}} +# username: ${{ secrets.SSH_TESTING_SERVER_USER }} +# password: ${{ secrets.SSH_TESTING_SERVER_PASSWORD }} +# concurrency: 2 From b73f7715daf6fe19a327698c8c89879ee1eb81b2 Mon Sep 17 00:00:00 2001 From: imedina Date: Fri, 23 Jun 2023 01:23:32 +0100 Subject: [PATCH 2/5] cicd: minor style fixes --- .github/workflows/develop.yml | 4 -- .github/workflows/release.yml | 3 -- .github/workflows/task.yml | 5 --- .github/workflows/test-analysis.yml | 64 +++++------------------------ 4 files changed, 10 insertions(+), 66 deletions(-) diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index 0c0a1f139..6a6391709 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -17,9 +17,6 @@ jobs: uses: ./.github/workflows/test-analysis.yml needs: build secrets: inherit -# with: -# report_context: development -# report_dir: ${{ github.ref_name }}/cellbase/${{ github.sha }} deploy-maven: uses: opencb/java-common-libs/.github/workflows/deploy-maven-repository-workflow.yml@release-4.6.x @@ -34,4 +31,3 @@ jobs: with: cli: python3 ./build/cloud/docker/docker-build.py push --images base secrets: inherit - diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index af69470db..49abc5ace 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,9 +16,6 @@ jobs: uses: ./.github/workflows/test-analysis.yml needs: build secrets: inherit -# with: -# report_context: xetabase -# report_dir: cellbase deploy-maven: uses: opencb/java-common-libs/.github/workflows/deploy-maven-repository-workflow.yml@release-4.6.x diff --git a/.github/workflows/task.yml b/.github/workflows/task.yml index 7018f4942..fb3daa0cd 100644 --- a/.github/workflows/task.yml +++ b/.github/workflows/task.yml @@ -16,9 +16,6 @@ jobs: uses: ./.github/workflows/test-analysis.yml needs: build secrets: inherit -# with: -# report_context: development -# report_dir: ${{ github.ref_name }}/cellbase/${{ github.sha }} deploy-docker: uses: opencb/java-common-libs/.github/workflows/deploy-docker-hub-workflow.yml@release-4.6.x @@ -26,5 +23,3 @@ jobs: with: cli: python3 ./build/cloud/docker/docker-build.py push --images base --tag ${{ github.ref_name }} secrets: inherit - - diff --git a/.github/workflows/test-analysis.yml b/.github/workflows/test-analysis.yml index 3bb74e7eb..76c571327 100644 --- a/.github/workflows/test-analysis.yml +++ b/.github/workflows/test-analysis.yml @@ -4,23 +4,7 @@ on: secrets: SONAR_TOKEN: required: true -# SSH_TESTING_SERVER_HOST: -# required: true -# SSH_TESTING_SERVER_PORT: -# required: true -# SSH_TESTING_SERVER_USER: -# required: true -# SSH_TESTING_SERVER_PASSWORD: -# required: true -# inputs: -# report_dir: -# type: string -# required: true -# report_context: -# type: string -# required: true -#env: -# xb_version: "1.7.0" + jobs: test: name: Test and push Sonar analysis @@ -54,40 +38,12 @@ jobs: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} run: mvn -B verify surefire-report:report -Dcheckstyle.skip org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=opencb_cellbase - name: Publish Test Report - uses: scacap/action-surefire-report@v1 - ## Skip cancelled() - ## https://docs.github.com/en/actions/learn-github-actions/expressions#cancelled - if: success() || failure() - with: - check_name: "Surefire tests report" - report_paths: './**/surefire-reports/TEST-*.xml' - commit: '${{ github.sha }}' - fail_on_test_failures: true - -# - name: Upload result dir -# uses: actions/upload-artifact@v3 -# with: -# name: workdir -# path: "**/target/site" -# publish-test: -# name: Publish test results -# runs-on: ubuntu-22.04 -# needs: test -# strategy: -# matrix: -# module: ["cellbase-core", "cellbase-app", "cellbase-client", "cellbase-lib", "cellbase-server"] -# steps: -# - name: Download result dir -# uses: actions/download-artifact@v3 -# with: -# name: workdir -# - name: Deploy unit tests web recursively to remote -# uses: garygrossgarten/github-action-scp@release -# with: -# local: ${{ matrix.module }}/target/site -# remote: /var/www/html/reports/${{ inputs.report_context }}/${{ env.xb_version }}/${{ inputs.report_dir }}/unit/${{ matrix.module }} -# host: ${{ secrets.SSH_TESTING_SERVER_HOST}} -# port: ${{ secrets.SSH_TESTING_SERVER_PORT}} -# username: ${{ secrets.SSH_TESTING_SERVER_USER }} -# password: ${{ secrets.SSH_TESTING_SERVER_PASSWORD }} -# concurrency: 2 + uses: scacap/action-surefire-report@v1 + ## Skip cancelled() + ## https://docs.github.com/en/actions/learn-github-actions/expressions#cancelled + if: success() || failure() + with: + check_name: "Surefire tests report" + report_paths: './**/surefire-reports/TEST-*.xml' + commit: '${{ github.sha }}' + fail_on_test_failures: true From 68190937f76e1773f85a7364cd3b3b7addf89921 Mon Sep 17 00:00:00 2001 From: JuanfeSanahuja Date: Fri, 23 Jun 2023 13:17:58 +0200 Subject: [PATCH 3/5] cicd: Set the fail-never in test #TASK-4464 --- .github/workflows/test-analysis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-analysis.yml b/.github/workflows/test-analysis.yml index 76c571327..d2bc8a55c 100644 --- a/.github/workflows/test-analysis.yml +++ b/.github/workflows/test-analysis.yml @@ -36,7 +36,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: mvn -B verify surefire-report:report -Dcheckstyle.skip org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=opencb_cellbase + run: mvn -B verify surefire-report:report --fail-never -Dcheckstyle.skip org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=opencb_cellbase - name: Publish Test Report uses: scacap/action-surefire-report@v1 ## Skip cancelled() From 7fc2bda412ef97adc683965653f764ba064e63d4 Mon Sep 17 00:00:00 2001 From: imedina Date: Sun, 25 Jun 2023 02:19:24 +0100 Subject: [PATCH 4/5] cicd: fix code style --- .github/workflows/pull-request-merge.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pull-request-merge.yml b/.github/workflows/pull-request-merge.yml index 2ae158453..4b1c43c68 100644 --- a/.github/workflows/pull-request-merge.yml +++ b/.github/workflows/pull-request-merge.yml @@ -1,4 +1,4 @@ -name: "Merge Workflow" +name: "Pull Request Merge Workflow" on: pull_request: @@ -13,6 +13,4 @@ jobs: uses: opencb/java-common-libs/.github/workflows/delete-docker-hub-workflow.yml@develop with: cli: python3 ./build/cloud/docker/docker-build.py delete --images base --tag ${{ github.head_ref }} - secrets: - DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }} - DOCKER_HUB_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }} + secrets: inherit From 0bfc3a23544f93a11d695e4a9cf64ca010d8a976 Mon Sep 17 00:00:00 2001 From: JuanfeSanahuja Date: Wed, 28 Jun 2023 12:15:51 +0200 Subject: [PATCH 5/5] CICD: Delete test step from release.yml #TASK-4464 --- .github/workflows/release.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 49abc5ace..1ecc875c3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,11 +12,6 @@ jobs: with: maven_opts: -DCELLBASE.WAR.NAME=cellbase - test: - uses: ./.github/workflows/test-analysis.yml - needs: build - secrets: inherit - deploy-maven: uses: opencb/java-common-libs/.github/workflows/deploy-maven-repository-workflow.yml@release-4.6.x needs: test