[ci] update pd report #1059
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Trigger Physical Design Workflow | |
on: | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
- reopened | |
- ready_for_review | |
- labeled | |
env: | |
USER: runner | |
# Cancel the current workflow when new commit pushed | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number }} | |
cancel-in-progress: true | |
jobs: | |
generate-test-plan: | |
if: '! github.event.pull_request.draft' | |
name: "Generate CI target for RTL elaborate" | |
runs-on: [self-hosted, linux, nixos] | |
outputs: | |
testplan: ${{ steps.get-testplan.outputs.testplan }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- id: "get-testplan" | |
run: | | |
testFile="./designs/org.chipsalliance.t1.elaborator.t1rocketv.T1RocketTile.toml" | |
jsonData=$(nix shell ".#dasel" -c dasel -r toml -f "$testFile" -w json) | |
echo "testplan=$(echo "$jsonData" | nix shell ".#jq" -c jq -c -r '{ "config": keys }')" \ | |
> $GITHUB_OUTPUT | |
test-emit: | |
name: "Test elaborate" | |
needs: [generate-test-plan] | |
runs-on: [self-hosted, linux, nixos] | |
strategy: | |
matrix: ${{ fromJSON(needs.generate-test-plan.outputs.testplan) }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: "Test elaborate" | |
run: | | |
testAttr="t1rocketv" | |
testConfig=${{ matrix.config }} | |
echo "Building .#t1.${testConfig}.${testAttr}.rtl" | |
nix build ".#t1.${testConfig}.${testAttr}.rtl" -L | |
physical-design-report: | |
name: "Request physical design report" | |
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 | |
printf "$JSON_CTX" > _ctx.json | |
pdType=$(jq -r 'map(select(. | test("^PD-Lane.*"))) | .[0]' _ctx.json) | |
if [[ -z "$pdType" ]] || [[ "$pdType" == "null" ]]; then | |
echo "Unable to filter Physical Design type" | |
exit 1 | |
fi | |
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 -Fc=@report.md -Fe=1M https://shz.al | jq -r .url)?lang=md" >> $GITHUB_STEP_SUMMARY | |
echo -e "\n\n" >> $GITHUB_STEP_SUMMARY |