Skip to content

Commit

Permalink
ci: combining results
Browse files Browse the repository at this point in the history
  • Loading branch information
harshilgajera-crest committed Aug 21, 2024
1 parent 28d8a99 commit 1a57f09
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions .github/workflows/reusable-build-test-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1013,7 +1013,8 @@ jobs:
matrix:
splunk: ${{ fromJson(needs.meta.outputs.matrix_supportedSplunk) }}
sc4s: ${{ fromJson(needs.meta.outputs.matrix_supportedSC4S) }}

outputs:
summary-${{ matrix.splunk }}-${{ matrix.sc4s }}: ${{ steps.parse-junit.outputs.summary }}
container:
image: ghcr.io/splunk/workflow-engine-base:4.1.0
env:
Expand Down Expand Up @@ -1237,10 +1238,10 @@ jobs:
echo "errors=$errors" >> $GITHUB_ENV
- name: Add job summary
run: |
echo "| Job | Total Tests | Passed | Failed | skipped | errors" >> $GITHUB_STEP_SUMMARY
echo "| --- | ----------- | ------ | ------ | ------- | ------ |" >> $GITHUB_STEP_SUMMARY
echo "| ${{ matrix.splunk }} | ${{ env.tests }} | ${{ env.passed }} | ${{ env.failed }} | ${{ env.skipped }} | ${{ env.errors }} |" >> $GITHUB_STEP_SUMMARY
summary="${{ matrix.splunk }}-${{ matrix.sc4s }}| ${{ env.tests }} | ${{ env.passed }} | ${{ env.failed }} | ${{ env.skipped }} | ${{ env.errors }} |"
echo "summary=$summary" >> $GITHUB_ENV
outputs:
summary: ${{ env.summary }}
- name: pull diag from s3 bucket
if: ${{ failure() && steps.test_report.outputs.conclusion == 'failure' }}
run: |
Expand All @@ -1253,6 +1254,22 @@ jobs:
path: |
${{ needs.setup.outputs.directory-path }}/diag*
finalize:
needs: run-knowledge-tests
runs-on: ubuntu-latest
steps:
- name: Combine summaries into a table
run: |
echo "| Splunk - SC4S | Total Tests | Passed | Failed | skipped | errors" >> $GITHUB_STEP_SUMMARY
echo "| ---------- | ----------- | ------ | ------ | ------ | ------ |" >> $GITHUB_STEP_SUMMARY
# Dynamically iterate over all matrix combinations
for splunk in ${{ fromJson(needs.ko-tests.strategy.matrix.splunk) }}; do
for sc4s in ${{ fromJson(needs.ko-tests.strategy.matrix.sc4s) }}; do
job_summary="${{ needs.run-knowledge-tests.outputs['summary-'$splunk'-'$sc4s] }}"
echo "$splunk-$sc4s | $job_summary" >> $GITHUB_STEP_SUMMARY
done
done
run-requirement-tests:
if: ${{ !cancelled() && needs.build.result == 'success' && needs.test-inventory.outputs.requirement_test == 'true' && needs.setup-workflow.outputs.execute-requirement-labeled == 'true' }}
Expand Down

0 comments on commit 1a57f09

Please sign in to comment.