diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index 4d58a094..2a8ffdd6 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -14,9 +14,9 @@ jobs: uses: ./.github/workflows/test-analysis.yml needs: build secrets: inherit - with: - report_context: development - report_dir: ${{ github.ref_name }}/java-common-libs/${{ github.sha }} +# with: +# report_context: development +# report_dir: ${{ github.ref_name }}/java-common-libs/${{ github.sha }} deploy-maven: uses: ./.github/workflows/deploy-maven-repository-workflow.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 42013c00..a4d2f7b4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,9 +13,9 @@ jobs: uses: ./.github/workflows/test-analysis.yml needs: build secrets: inherit - with: - report_context: xetabase - report_dir: java-common-libs +# with: +# report_context: xetabase +# report_dir: java-common-libs deploy-maven: uses: ./.github/workflows/deploy-maven-repository-workflow.yml diff --git a/.github/workflows/task.yml b/.github/workflows/task.yml index 56fa91e7..a69c6587 100644 --- a/.github/workflows/task.yml +++ b/.github/workflows/task.yml @@ -13,6 +13,6 @@ jobs: uses: ./.github/workflows/test-analysis.yml needs: build secrets: inherit - with: - report_context: development - report_dir: ${{ github.ref_name }}/java-common-libs/${{ github.sha }} +# with: +# report_context: development +# report_dir: ${{ github.ref_name }}/java-common-libs/${{ github.sha }} diff --git a/.github/workflows/test-analysis.yml b/.github/workflows/test-analysis.yml index 47499525..908c97b7 100644 --- a/.github/workflows/test-analysis.yml +++ b/.github/workflows/test-analysis.yml @@ -1,6 +1,13 @@ name: Build and test the project on: workflow_call: +# inputs: +# report_dir: +# type: string +# required: true +# report_context: +# type: string +# required: true secrets: SONAR_TOKEN: required: true @@ -12,15 +19,10 @@ on: 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.8.0" + +#env: +# xb_version: "1.8.0" + jobs: test: name: Test and push Sonar analysis @@ -44,31 +46,41 @@ 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 org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=opencb_java-common-libs - - 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: ["commons-lib", "commons-datastore", "commons-datastore/commons-datastore-core", "commons-datastore/commons-datastore-mongodb", "commons-datastore/commons-datastore-solr"] - 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 + run: mvn -B verify surefire-report:report --fail-never org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=opencb_java-common-libs + - 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: - 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 + 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: ["commons-lib", "commons-datastore", "commons-datastore/commons-datastore-core", "commons-datastore/commons-datastore-mongodb", "commons-datastore/commons-datastore-solr"] +# 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