From 6882e1a7d67cdcc8189d5cf869ea0e39c46f2f74 Mon Sep 17 00:00:00 2001 From: Avimitin Date: Wed, 11 Dec 2024 14:39:10 +0800 Subject: [PATCH] [ci] replace short link url with PR comment Signed-off-by: Avimitin --- .github/workflows/pd.yml | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/.github/workflows/pd.yml b/.github/workflows/pd.yml index 4a2545321..375a61f59 100644 --- a/.github/workflows/pd.yml +++ b/.github/workflows/pd.yml @@ -82,13 +82,14 @@ jobs: exit 1 fi - nix build --impure --out-link fc-result \ + _OUTPUT_DIR="fc_result" + nix build --impure --out-link ${_OUTPUT_DIR} \ --override-input t1 "github:chipsalliance/t1/${T1_BRANCH}" \ "git+https://${GH_TOKEN}@${PD_URL}#prometheus.${T1_CONFIG}.tsn28-run-fc-rm.T1RocketTile" _CODE_BLOCK='```' - echo "* Artifacts path: $(realpath fc-result)" >> "$GITHUB_STEP_SUMMARY" + echo "* Artifacts path: $(realpath ${_OUTPUT_DIR})" >> "$GITHUB_STEP_SUMMARY" tee report.md <<-EOF T1RocketTile PD Reports ======================= @@ -103,27 +104,36 @@ jobs: Timing ------ ${_CODE_BLOCK}text - $(cat fc-result/timing_*.rpt) + $(cat ${_OUTPUT_DIR}/reports/timing_*.rpt) ${_CODE_BLOCK} Area ---- ${_CODE_BLOCK}text - $(cat fc-result/area.rpt) + $(cat ${_OUTPUT_DIR}/reports/area.rpt) ${_CODE_BLOCK} Power ----- ${_CODE_BLOCK}text - $(cat fc-result/power.rpt) + $(cat ${_OUTPUT_DIR}/reports/power.rpt) ${_CODE_BLOCK} Logic Level ----------- ${_CODE_BLOCK}text - $(cat fc-result/logic_levels.rpt) + $(cat ${_OUTPUT_DIR}/reports/logic_levels.rpt) ${_CODE_BLOCK} EOF - - echo "* Report Short link URL:" >> $GITHUB_STEP_SUMMARY - echo "<$(curl -Fc=@report.md -Fe=1M https://shz.al | jq -r .url)?lang=md>" >> $GITHUB_STEP_SUMMARY + - name: "Comment on PR" + uses: actions/github-script@v7 + with: + script: | + const fs = require('fs') + const body = fs.readFileSync('report.md', 'utf-8') + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: body + })