Skip to content

Commit

Permalink
ci: Add log artifact on XTS failure (#16546)
Browse files Browse the repository at this point in the history
Signed-off-by: Mihail Mihov <[email protected]>
  • Loading branch information
mishomihov00 authored Nov 14, 2024
1 parent 5cd5714 commit 1ba89f5
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/zxcron-extended-test-suite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -248,12 +248,42 @@ jobs:
needs.hedera-node-jrs-panel.result != 'success' ||
needs.tag-for-promotion.result != 'success') &&
!cancelled() && always() }}

steps:
- name: Harden Runner
uses: step-security/harden-runner@f086349bfa2bd1361f7909c78558e816508cdc10 # v2.8.0
with:
egress-policy: audit

- name: Checkout Code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: '0'
ref: develop
token: ${{ secrets.GH_ACCESS_TOKEN }}

- name: Collect run logs in a log file
env:
GH_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
run: |
for job_id in $(gh run view ${{ github.run_id }} --json jobs --jq '.jobs | map(.databaseId) | .[0:-1] | .[]'); do
echo "Fetching logs for job $job_id..."
current_job_name=$(gh run view ${{ github.run_id }} --json jobs | jq --argjson job_id "$job_id" -r '.jobs[] | select(.databaseId == $job_id) | .name')
echo "Logs for job $current_job_name :" >> run.log
gh api \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/hashgraph/hedera-services/actions/jobs/$job_id/logs >> run.log
done
- name: Upload log as artifact
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
path: run.log

- name: Report failure (slack)
uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0
env:
Expand Down

0 comments on commit 1ba89f5

Please sign in to comment.