Skip to content

Commit

Permalink
cicd: Upload tests logs as artifacts. Reduce action log size. #TASK-6722
Browse files Browse the repository at this point in the history
  • Loading branch information
j-coll committed Nov 29, 2024
1 parent c48ce0a commit f2bc782
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions .github/workflows/test-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,24 @@ jobs:
with:
mongodb-version: 6.0
mongodb-replica-set: rs-test
- name: Maven build
- name: Maven build (skip tests)
run: mvn -B clean install -DskipTests -P ${{ inputs.hadoop }} -Dcheckstyle.skip ${{ inputs.mvn_opts }}
- name: Build Junit log file name
id: BuildJunitLogFileName
run: |
MODULE=$(basename ${{ inputs.module }})
if [[ -z "$MODULE" ]]; then
MODULE="opencga"
fi
TAGS=$(echo ${{ inputs.test_profile }} | sed -e 's/run\([^,]*\)Tests/\1/g' | tr ',' '_' | tr '[:upper:]' '[:lower:]' )
echo "TESTS_LOG_FILE_NAME=junit_${{ inputs.hadoop }}_${TAGS}_${MODULE}.log" >> $GITHUB_OUTPUT
- name: Run Junit tests
run: mvn -B verify surefire-report:report --fail-never -Dsurefire.testFailureIgnore=true -f ${{ (inputs.module == '' || inputs.module == 'all') && '.' || inputs.module }} -P ${{ inputs.hadoop }},${{ inputs.test_profile }} -Dcheckstyle.skip ${{ inputs.mvn_opts }}
run: mvn -B verify surefire-report:report --fail-never -Dsurefire.testFailureIgnore=true -f ${{ (inputs.module == '' || inputs.module == 'all') && '.' || inputs.module }} -P ${{ inputs.hadoop }},${{ inputs.test_profile }} -Dcheckstyle.skip ${{ inputs.mvn_opts }} |& tee ${{ steps.BuildJunitLogFileName.outputs.TESTS_LOG_FILE_NAME }} |& grep -P '^\[[^\]]*(INFO|WARNING|ERROR)' --colour=never --line-buffered
- name: Upload Junit test logs
uses: actions/upload-artifact@v4
with:
name: ${{ steps.BuildJunitLogFileName.outputs.TESTS_LOG_FILE_NAME }}
path: ${{ steps.BuildJunitLogFileName.outputs.TESTS_LOG_FILE_NAME }}
- name: Publish Test Report on GitHub
uses: scacap/action-surefire-report@v1
env:
Expand Down

0 comments on commit f2bc782

Please sign in to comment.