Profile Guest #441
This file contains hidden or 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: Profile Guest | |
| on: | |
| workflow_run: | |
| workflows: ["Build Guest"] | |
| types: | |
| - completed | |
| jobs: | |
| profile-guest: | |
| if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| - name: Download artifact (chunk app.vmexe) | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: chunk-app-vmexe | |
| path: ./crates/circuits/chunk-circuit/openvm/ | |
| - name: Setup rust | |
| uses: dtolnay/rust-toolchain@56f84321dbccf38fb67ce29ab63e4754056677e0 | |
| with: | |
| toolchain: nightly-2025-08-18 | |
| - name: Guest profiling to capture total_cycles | |
| id: guest-profiling | |
| run: | | |
| # Run the tests and capture the output | |
| output=$(make profile-chunk | grep "scroll-zkvm-integration(chunk-circuit): total cycles = ") | |
| echo "total_cycles=$output" >> $GITHUB_OUTPUT | |
| - name: Update PR Description | |
| uses: actions/github-script@v6 | |
| env: | |
| TOTAL_CYCLES: ${{ steps.guest-profiling.outputs.total_cycles }} | |
| with: | |
| script: | | |
| const prNumber = context.payload.pull_request.number; | |
| const totalCycles = '${TOTAL_CYCLES}'; | |
| const currentBody = context.payload.pull_request.body; | |
| // Update the PR description with the total cycles | |
| const newBody = `### Total Cycles (chunk-circuit)\n${totalCycles}\n\n${currentBody}`; | |
| await github.pulls.update({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| pull_number: prNumber, | |
| body: newBody, | |
| }); |