Skip to content

Commit 5f367b8

Browse files
committed
Fix artifact URL for scheduled real-time benchmark workflows
[skip ci]
1 parent b40f38b commit 5f367b8

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

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

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ jobs:
8787
8888
- name: Install dependencies
8989
run: |
90-
set -ex
90+
set -e
9191
sudo apt-get update
9292
sudo apt-get install gpg
9393
@@ -266,12 +266,27 @@ jobs:
266266
sed -i 's|extra_title = ""|extra_title = "Changeset"|g' ./php-version-benchmarks/build/infrastructure/config/aws.tfvars
267267
sed -i "s|extra_text = \"\"|extra_text = \"$CHANGESET_URL\"|g" ./php-version-benchmarks/build/infrastructure/config/aws.tfvars
268268
- name: Run benchmark
269-
run: ./php-version-benchmarks/benchmark.sh run aws
270-
- name: Store results
269+
run: |
270+
set -e
271+
272+
./php-version-benchmarks/benchmark.sh run aws
273+
274+
echo "NEWEST_RESULT_DIRECTORY=$(ls -td ${{ github.workspace }}/php-version-benchmarks/docs/results/${{ env.YEAR }}/*/ | head -1)" >> $GITHUB_ENV
275+
- name: Upload artifacts
276+
id: upload
277+
uses: actions/upload-artifact@v6
278+
with:
279+
name: results
280+
path: |
281+
./php-version-benchmarks/tmp/results/${{ env.YEAR }}/**/*
282+
retention-days: 30
283+
- name: Commit results
271284
if: github.repository == 'php/php-src' && github.event_name != 'workflow_dispatch'
272285
run: |
273286
set -ex
274287
288+
sed -i "s|#ARTIFACT_URL#|${{ steps.upload.outputs.artifact-url }}|g" "${NEWEST_RESULT_DIRECTORY}result.md"
289+
275290
cd ./php-version-benchmarks/docs/results
276291
git pull --autostash
277292
if [ -e ".git/MERGE_HEAD" ]; then
@@ -284,20 +299,10 @@ jobs:
284299
fi
285300
git commit -m "Add result for ${{ github.repository }}@${{ github.sha }}"
286301
git push
287-
- name: Upload artifacts
288-
id: upload
289-
uses: actions/upload-artifact@v6
290-
with:
291-
name: results
292-
path: |
293-
./php-version-benchmarks/tmp/results/${{ env.YEAR }}/**/*
294-
retention-days: 30
295302
- name: Comment results
296303
if: github.event_name == 'workflow_dispatch'
297304
env:
298305
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
299306
run: |
300307
cd ./php-version-benchmarks/tmp/php_${{ env.ID }}
301-
NEWEST_RESULT_DIRECTORY=$(ls -td ${{ github.workspace }}/php-version-benchmarks/docs/results/${{ env.YEAR }}/*/ | head -1)
302-
sed -i "s|#ARTIFACT_URL#|${{ steps.upload.outputs.artifact-url }}|g" "${NEWEST_RESULT_DIRECTORY}result.md"
303308
gh pr comment ${{ inputs.pull_request }} --body-file "${NEWEST_RESULT_DIRECTORY}result.md" --repo ${{ github.repository }}

0 commit comments

Comments
 (0)