Skip to content

Commit c65adba

Browse files
authored
Various improvements for the Real time benchmark (php#20930)
- Ubuntu is updated to 24.04 - Log files are also uploaded as artifact - The baseline commit is now correctly set to the merge base commit when the workflow is manually started on a PR
1 parent 858d34f commit c65adba

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

.github/workflows/real-time-benchmark.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
REAL_TIME_BENCHMARK:
6161
name: REAL_TIME_BENCHMARK
6262
if: github.repository == 'php/php-src' || github.event_name == 'workflow_dispatch'
63-
runs-on: ubuntu-22.04
63+
runs-on: ubuntu-24.04
6464
env:
6565
REPOSITORY: ${{ github.repository }}
6666
BRANCH: "master"
@@ -82,7 +82,7 @@ jobs:
8282
echo "YEAR=$YEAR" >> $GITHUB_ENV
8383
8484
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
85-
PR_INFO=$(gh pr view ${{ inputs.pull_request }} --json headRepositoryOwner,headRepository,headRefName,headRefOid,baseRefOid --repo ${{ github.repository }} | jq -r '.headRepositoryOwner.login, .headRepository.name, .headRefName, .headRefOid, .baseRefOid')
85+
PR_INFO=$(gh pr view ${{ inputs.pull_request }} --json headRepositoryOwner,headRepository,headRefName,headRefOid,baseRefName --repo ${{ github.repository }} | jq -r '.headRepositoryOwner.login, .headRepository.name, .headRefName, .headRefOid, .baseRefName')
8686
8787
REPOSITORY="$(echo "$PR_INFO" | sed -n '1p')/$(echo "$PR_INFO" | sed -n '2p')"
8888
echo "REPOSITORY=$REPOSITORY" >> $GITHUB_ENV
@@ -93,7 +93,9 @@ jobs:
9393
COMMIT=$(echo "$PR_INFO" | sed -n '4p')
9494
echo "COMMIT=$COMMIT" >> $GITHUB_ENV
9595
96-
BASELINE_COMMIT=$(echo "$PR_INFO" | sed -n '5p')
96+
BASELINE_BRANCH=$(echo "$PR_INFO" | sed -n '5p')
97+
98+
BASELINE_COMMIT=$(gh api /repos/${{ github.repository }}/compare/$BASELINE_BRANCH...$COMMIT --jq '.merge_base_commit.sha')
9799
echo "BASELINE_COMMIT=$BASELINE_COMMIT" >> $GITHUB_ENV
98100
99101
echo "ID=benchmarked" >> $GITHUB_ENV
@@ -288,12 +290,14 @@ jobs:
288290
fi
289291
git commit -m "Add result for ${{ github.repository }}@${{ github.sha }}"
290292
git push
291-
- name: Upload artifact
293+
- name: Upload artifacts
292294
if: github.event_name == 'workflow_dispatch'
293295
uses: actions/upload-artifact@v6
294296
with:
295297
name: results
296-
path: ./php-version-benchmarks/docs/results/${{ env.YEAR }}
298+
path: |
299+
./php-version-benchmarks/tmp/results/${{ env.YEAR }}/*/*.*
300+
./php-version-benchmarks/tmp/results/${{ env.YEAR }}/*/*/*.log
297301
retention-days: 30
298302
- name: Comment results
299303
if: github.event_name == 'workflow_dispatch'

0 commit comments

Comments
 (0)