-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
159 lines (138 loc) · 5.42 KB
/
Copy pathweb-benchmarks.yml
File metadata and controls
159 lines (138 loc) · 5.42 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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
name: 'Web benchmarks'
on:
push:
branches: [master]
env:
LADYBIRD_SOURCE_DIR: ${{ github.workspace }}
CCACHE_DIR: ${{ github.workspace }}/.ccache
VCPKG_ROOT: ${{ github.workspace }}/Build/vcpkg
jobs:
web-benchmarks:
runs-on: ${{ fromJSON(matrix.runner_labels) }}
if: ${{ github.repository == 'LadybirdBrowser/ladybird' }}
name: ${{ matrix.os_name }}, ${{ matrix.arch }}
container: ${{ fromJSON(matrix.container) }}
strategy:
fail-fast: false
matrix:
os_name: ['Linux']
arch: ['x86_64']
runner_labels: ['["ubuntu-24.04-internal", "web-benchmarks", "self-hosted"]']
container: [&ci_container '{"image":"ghcr.io/ladybirdbrowser/ladybird-ci:2026.07.04"}']
include:
- os_name: 'macOS'
arch: 'arm64'
runner_labels: '["macos-26", "web-benchmarks", "self-hosted"]'
container: 'null'
permissions:
actions: read
contents: read
steps:
- name: 'Checkout ladybird'
uses: actions/checkout@v7.0.0
with:
ref: ${{ github.sha }}
- name: 'Determine ladybird commit hash'
id: ladybird-commit
shell: bash
run: |
echo "sha=${{ github.sha }}" >> "${GITHUB_OUTPUT}"
- name: 'Checkout LadybirdBrowser/web-benchmarks'
uses: actions/checkout@v7.0.0
with:
repository: LadybirdBrowser/web-benchmarks
path: web-benchmarks
ref: master
- name: 'Determine web-benchmarks commit hash'
id: web-benchmarks-commit
shell: bash
run: |
cd web-benchmarks
echo "sha=$(git rev-parse HEAD)" >> "${GITHUB_OUTPUT}"
- name: 'Set Up Environment'
id: 'setup'
uses: ./.github/actions/setup
with:
os: ${{ matrix.os_name }}
arch: ${{ matrix.arch }}
toolchain: 'Clang'
- name: 'Restore Caches'
uses: ./.github/actions/cache-restore
id: 'cache-restore'
with:
os: ${{ matrix.os_name }}
arch: ${{ matrix.arch }}
toolchain: 'Clang'
cache_key_extra: 'Distribution'
ccache_path: ${{ steps.setup.outputs.ccache_path }}
vcpkg_cache_path: ${{ steps.setup.outputs.vcpkg_cache_path }}
- name: 'Assign Build Parameters'
id: 'build-parameters'
shell: bash
run: |
if ${{ matrix.os_name == 'Linux' }} ; then
echo "host_cc=clang" >> "$GITHUB_OUTPUT"
echo "host_cxx=clang++" >> "$GITHUB_OUTPUT"
elif ${{ matrix.os_name == 'macOS' }} ; then
echo "host_cc=$(xcrun --find clang)" >> "$GITHUB_OUTPUT"
echo "host_cxx=$(xcrun --find clang++)" >> "$GITHUB_OUTPUT"
fi
- name: 'Create Build Environment'
working-directory: ${{ github.workspace }}
run: |
cmake --preset Distribution -B Build \
-DENABLE_CI_BASELINE_CPU=ON \
-DPython3_EXECUTABLE=${{ env.pythonLocation }}/bin/python \
-DCMAKE_C_COMPILER=${{ steps.build-parameters.outputs.host_cc }} \
-DCMAKE_CXX_COMPILER=${{ steps.build-parameters.outputs.host_cxx }}
- name: 'Build'
working-directory: ${{ github.workspace }}/Build
run: |
cmake --build .
cmake --install . --strip --prefix "${GITHUB_WORKSPACE}/Install"
- name: 'Save Caches'
uses: ./.github/actions/cache-save
with:
arch: ${{ matrix.arch }}
ccache_path: ${{ steps.setup.outputs.ccache_path }}
ccache_primary_key: ${{ steps.cache-restore.outputs.ccache_primary_key }}
vcpkg_cache_path: ${{ steps.setup.outputs.vcpkg_cache_path }}
vcpkg_cache_primary_key: ${{ steps.cache-restore.outputs.vcpkg_cache_primary_key }}
- name: 'Run the benchmarks'
shell: bash
run: |
cd web-benchmarks
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install -r requirements.txt
if [ "${{ matrix.os_name }}" = "macOS" ]; then
executable="${GITHUB_WORKSPACE}/Install/bundle/Ladybird.app/Contents/MacOS/Ladybird"
else
executable="${GITHUB_WORKSPACE}/Install/bin/Ladybird"
fi
./run.py --iterations=5 --executable="${executable}"
- name: 'Save results as an artifact'
uses: actions/upload-artifact@v7
with:
name: web-benchmarks-results-${{ matrix.os_name }}-${{ matrix.arch }}
path: web-benchmarks/results.json
retention-days: 90
- name: 'Call webhook'
shell: bash
run: |
echo '{
"commit": "${{ steps.ladybird-commit.outputs.sha }}",
"benchmarks_commit": "${{ steps.web-benchmarks-commit.outputs.sha }}",
"os": "${{ matrix.os_name }}",
"arch": "${{ matrix.arch }}",
"artifact": "web-benchmarks-results-${{ matrix.os_name }}-${{ matrix.arch }}",
"artifact_run_id": "${{ github.run_id }}"
}' > request.json
curl \
--fail \
--silent \
--show-error \
--header 'Content-Type: application/json' \
--header "X-Hub-Signature-256: sha256=$(openssl dgst -sha256 -hmac '${{ secrets.JS_BENCHMARKS_WEBHOOK_SECRET }}' request.json | cut -d' ' -f2)" \
--data-binary '@request.json' \
'${{ secrets.JS_BENCHMARKS_WEBHOOK_URL }}'