diff --git a/.github/workflows/comment-profiling-changes.yaml b/.github/workflows/comment-profiling-changes.yaml index 0b35c61096..4fe552cf12 100644 --- a/.github/workflows/comment-profiling-changes.yaml +++ b/.github/workflows/comment-profiling-changes.yaml @@ -75,32 +75,14 @@ jobs: git checkout ${{ github.event.pull_request.head.sha }} - name: Run PR benchmarks - id: benchmark run: | # Compile benchmarks - COMPILE_OUTPUT=$(cargo bench --bench compile_demo_art_iai -- --baseline=master --output-format=json | jq -sc | sed 's/\\"//g') + cargo bench --bench compile_demo_art_iai -- --baseline=master --output-format=json | jq -sc > /tmp/compile_output.json - # Runtime benchmarks - UPDATE_OUTPUT=$(cargo bench --bench update_executor_iai -- --baseline=master --output-format=json | jq -sc | sed 's/\\"//g') - RUN_ONCE_OUTPUT=$(cargo bench --bench run_once_iai -- --baseline=master --output-format=json | jq -sc | sed 's/\\"//g') - RUN_CACHED_OUTPUT=$(cargo bench --bench run_cached_iai -- --baseline=master --output-format=json | jq -sc | sed 's/\\"//g') - - # Store outputs - echo "COMPILE_OUTPUT<> $GITHUB_OUTPUT - echo "$COMPILE_OUTPUT" >> $GITHUB_OUTPUT - echo "EOF" >> $GITHUB_OUTPUT - - echo "UPDATE_OUTPUT<> $GITHUB_OUTPUT - echo "$UPDATE_OUTPUT" >> $GITHUB_OUTPUT - echo "EOF" >> $GITHUB_OUTPUT - - echo "RUN_ONCE_OUTPUT<> $GITHUB_OUTPUT - echo "$RUN_ONCE_OUTPUT" >> $GITHUB_OUTPUT - echo "EOF" >> $GITHUB_OUTPUT - - echo "RUN_CACHED_OUTPUT<> $GITHUB_OUTPUT - echo "$RUN_CACHED_OUTPUT" >> $GITHUB_OUTPUT - echo "EOF" >> $GITHUB_OUTPUT + # Runtime benchmarks + cargo bench --bench update_executor_iai -- --baseline=master --output-format=json | jq -sc > /tmp/update_output.json + cargo bench --bench run_once_iai -- --baseline=master --output-format=json | jq -sc > /tmp/run_once_output.json + cargo bench --bench run_cached_iai -- --baseline=master --output-format=json | jq -sc > /tmp/run_cached_output.json - name: Make old comments collapsed by default uses: actions/github-script@v7 @@ -132,10 +114,12 @@ jobs: with: github-token: ${{secrets.GITHUB_TOKEN}} script: | - const compileOutput = JSON.parse(`${{ steps.benchmark.outputs.COMPILE_OUTPUT }}`); - const updateOutput = JSON.parse(`${{ steps.benchmark.outputs.UPDATE_OUTPUT }}`); - const runOnceOutput = JSON.parse(`${{ steps.benchmark.outputs.RUN_ONCE_OUTPUT }}`); - const runCachedOutput = JSON.parse(`${{ steps.benchmark.outputs.RUN_CACHED_OUTPUT }}`); + const fs = require('fs'); + + const compileOutput = JSON.parse(fs.readFileSync('/tmp/compile_output.json', 'utf8')); + const updateOutput = JSON.parse(fs.readFileSync('/tmp/update_output.json', 'utf8')); + const runOnceOutput = JSON.parse(fs.readFileSync('/tmp/run_once_output.json', 'utf8')); + const runCachedOutput = JSON.parse(fs.readFileSync('/tmp/run_cached_output.json', 'utf8')); let significantChanges = false; let commentBody = "";