Skip to content

Commit

Permalink
[ci] update pd report
Browse files Browse the repository at this point in the history
Signed-off-by: Avimitin <[email protected]>
  • Loading branch information
Avimitin committed Dec 9, 2024
1 parent 6bbb5c3 commit dfa230c
Showing 1 changed file with 45 additions and 15 deletions.
60 changes: 45 additions & 15 deletions .github/workflows/pd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,20 @@ jobs:
if: ${{ success() && (contains(github.event.pull_request.labels.*.name, 'PD-Lane') || contains(github.event.pull_request.labels.*.name, 'PD-Lane-DBG'))}}
runs-on: ubuntu-latest
needs: [test-emit]
strategy:
matrix:
config:
- blastoise
- rookiedee
steps:
- name: "Request report"
env:
# Use env key can help us inspect the data
GH_TOKEN: ${{ secrets.T1_PR_PAT }}
JSON_CTX: ${{ toJson(github.event.pull_request.labels.*.name) }}
T1_BRANCH: ${{ github.head_ref || github.ref_name }}
T1_CONFIG: ${{ matrix.config }}
PD_URL: ${{ secrets.T1_INHOUSE_URL }}
run: |
# GitHub `toJson` will pretty print JSON and causing multiple line escape issue
# So we have to redirect it to file here
Expand All @@ -70,18 +79,39 @@ jobs:
exit 1
fi
commitSha="${{ github.event.pull_request.head.sha }}"
prId="${{ github.event.pull_request.number }}"
jq -n \
--arg commit_sha "$commitSha" \
--arg pr_id "$prId" \
--arg pd_type "$pdType" \
'{"event_type":"ci_success","client_payload":{"commit_sha": $commit_sha,"pr_id": $pr_id, "pd_type": $pd_type }}' \
> payload.json
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.T1_INHOUSE_PAT }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"${{ secrets.T1_INHOUSE_URL }}" \
-d '@payload.json'
nix build --impure --out-link fc-result \
--override-input t1 "github:chipsalliance/t1/${T1_BRANCH}" \
"git+https://${GH_TOKEN}@${PD_URL}#prometheus.${T1_CONFIG}.tsn28-run-fc-rm.T1RocketTile"
echo "* Artifacts path: $(realpath fc-result)\n" >> "$GITHUB_STEP_SUMMARY"
cd fc-result
echo -e "# Reports\n" > report.md
echo -e "$(date)\n" >> report.md
echo -e "Generated on T1RocketTile:\n" >> report.md
echo "* commit ${{ github.event.pull_request.head.sha }}" >> report.md
echo "* branch $T1_BRANCH" >> report.md
echo "* config $T1_CONFIG" >> report.md
echo -e '## Timing\n' >> report.md
echo -e '```text\n' >> report.md
cat timing_*.rpt >> report.md
echo -e '```\n' >> report.md
echo -e '## Area\n' >> report.md
echo -e '```text\n' >> report.md
cat area.rpt >> report.md
echo -e '```\n' >> report.md
echo -e '## Power\n' >> report.md
echo -e '```text\n' >> report.md
cat power.rpt >> report.md
echo -e '```\n' >> report.md
echo -e '## Logic Level\n' >> report.md
echo -e '```text\n' >> report.md
cat logic_levels.rpt >> report.md
echo -e '```\n' >> report.md
echo "* Report Short link URL:" >> $GITHUB_STEP_SUMMARY
echo "$(curl [email protected] -Fe=1M https://shz.al | jq -r .url)?lang=md" >> $GITHUB_STEP_SUMMARY
echo -e "\n\n" >> $GITHUB_STEP_SUMMARY

0 comments on commit dfa230c

Please sign in to comment.