-
-
Notifications
You must be signed in to change notification settings - Fork 49
135 lines (119 loc) · 4.38 KB
/
job-benchmark-tests.yml
File metadata and controls
135 lines (119 loc) · 4.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
on:
workflow_call:
jobs:
benchmark-tests:
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
dependencies:
- "locked"
php-version:
- "8.3"
operating-system:
- "ubuntu-latest"
steps:
- name: "Checkout"
uses: "actions/checkout@v5"
- name: "Setup PHP Environment"
uses: "./.github/actions/setup-php-env"
with:
php-version: "${{ matrix.php-version }}"
dependencies: "locked"
coverage: "none"
extensions: ':psr, bcmath, dom, hash, json, mbstring, xml, xmlwriter, xmlreader, zlib, snappy-https://github.com/kjdev/php-ext-snappy@0.2.1'
php-env: '{"SNAPPY_CONFIGURE_PREFIX_OPTS": "CXXFLAGS=-std=c++11"}'
cache-key-suffix: "-locked"
- name: "Download phpbench benchmarks artifact"
uses: dawidd6/action-download-artifact@v11
with:
workflow: baseline.yml
name: phpbench-baseline
path: ./var/phpbench/
- name: "Execute benchmarks"
id: init_comment
run: |
# Run all benchmarks in parallel
composer test:benchmark:extractor -- --ref=1.x --progress=none --iterations=1 > ./var/phpbench/extractor.txt 2>&1 &
PID_EXTRACTOR=$!
composer test:benchmark:transformer -- --ref=1.x --progress=none --iterations=1 > ./var/phpbench/transformer.txt 2>&1 &
PID_TRANSFORMER=$!
composer test:benchmark:loader -- --ref=1.x --progress=none --iterations=1 > ./var/phpbench/loader.txt 2>&1 &
PID_LOADER=$!
composer test:benchmark:building_blocks -- --ref=1.x --progress=none --iterations=1 > ./var/phpbench/building_blocks.txt 2>&1 &
PID_BUILDING=$!
composer test:benchmark:parquet-library -- --ref=1.x --progress=none --iterations=1 > ./var/phpbench/parquet.txt 2>&1 &
PID_PARQUET=$!
# Wait for all to complete and capture exit codes
EXIT_CODE=0
wait $PID_EXTRACTOR || EXIT_CODE=$?
wait $PID_TRANSFORMER || EXIT_CODE=$?
wait $PID_LOADER || EXIT_CODE=$?
wait $PID_BUILDING || EXIT_CODE=$?
wait $PID_PARQUET || EXIT_CODE=$?
if [ $EXIT_CODE -ne 0 ]; then
echo "One or more benchmarks failed with exit code $EXIT_CODE"
exit $EXIT_CODE
fi
# Build the summary file
{
echo '# Flow PHP - Benchmarks'
echo '<sup><sub>Results of the benchmarks from this PR are compared with the results from 1.x branch.</sub></sup>'
echo ' '
echo '<details><summary>Extractors</summary>'
echo ' '
echo '```shell'
cat ./var/phpbench/extractor.txt
echo '```'
echo ' '
echo '</details>'
echo ' '
echo '<details><summary>Transformers</summary>'
echo ' '
echo '```shell'
cat ./var/phpbench/transformer.txt
echo '```'
echo ' '
echo '</details>'
echo ' '
echo '<details><summary>Loaders</summary>'
echo ' '
echo '```shell'
cat ./var/phpbench/loader.txt
echo '```'
echo ' '
echo '</details>'
echo ' '
echo '<details><summary>Building Blocks</summary>'
echo ' '
echo '```shell'
cat ./var/phpbench/building_blocks.txt
echo '```'
echo ' '
echo '</details>'
echo ' '
echo '<details><summary>Parquet Library</summary>'
echo ' '
echo '```shell'
cat ./var/phpbench/parquet.txt
echo '```'
echo ' '
echo '</details>'
echo ' '
} >> "./var/phpbench/summary.txt"
- uses: actions/upload-artifact@v6
with:
name: phpbench
path: ./var/phpbench/summary.txt
overwrite: true
- name: Save PR number
run: echo ${{ github.event.pull_request.number }} > ./pr-id.txt
- name: Upload PR number
uses: actions/upload-artifact@v6
with:
name: pr
path: ./pr-id.txt
overwrite: true
- name: "Set job summary"
run: |
cat ./var/phpbench/summary.txt >> $GITHUB_STEP_SUMMARY