Skip to content

Commit

Permalink
cicd: remove test report copy
Browse files Browse the repository at this point in the history
  • Loading branch information
imedina committed Jun 18, 2023
1 parent 58ea462 commit 2125d06
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 45 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
84 changes: 48 additions & 36 deletions .github/workflows/test-analysis.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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

0 comments on commit 2125d06

Please sign in to comment.