Add linux-pref job (#33261)

Job will do some performance benchmarks (Dromeo, Speedometer) and mesure binary size and will report results to bencher.dev

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Co-authored-by: DK Liao <dklassic@gmail.com>
This commit is contained in:
Samson 2024-12-06 08:32:26 +01:00 committed by GitHub
parent 61ca2dde29
commit faefed9869
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 180 additions and 0 deletions

View file

@ -17,6 +17,9 @@ on:
unit-tests:
required: true
type: boolean
bencher:
required: true
type: boolean
jobs:
win:
@ -49,6 +52,7 @@ jobs:
wpt-layout: ${{ inputs.wpt-layout }}
unit-tests: ${{ inputs.unit-tests }}
wpt-args: ${{ inputs.wpt-args }}
bencher: ${{ inputs.bencher }}
lint:
if: ${{ inputs.workflow == 'lint' }}

85
.github/workflows/linux-bencher.yml vendored Normal file
View file

@ -0,0 +1,85 @@
name: Linux WPT Tests
on:
workflow_call:
permissions:
checks: write
pull-requests: write
env:
RUST_BACKTRACE: 1
SHELL: /bin/bash
# allows overriding bencher project for pushes
BENCHER_PROJECT: ${{ vars.BENCHER_PROJECT || 'servo' }}
jobs:
linux-bencher:
name: Bencher
# keep this in sync with testbed
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
if: github.event_name != 'pull_request_target'
with:
fetch-depth: 0
# This is necessary to checkout the pull request if this run was triggered via a
# `pull_request_target` event.
- uses: actions/checkout@v4
if: github.event_name == 'pull_request_target'
with:
ref: refs/pull/${{ github.event.number }}/head
fetch-depth: 0
- uses: actions/download-artifact@v4
with:
name: release-binary-linux
path: release-binary-linux
- name: unPackage binary
run: tar -xzf release-binary-linux/target.tar.gz
- name: Bootstrap dependencies
run: |
python3 -m pip install --upgrade pip
sudo apt update
sudo apt install -qy --no-install-recommends mesa-vulkan-drivers
python3 ./mach bootstrap --skip-lints
- uses: bencherdev/bencher@main
- name: File size
run: ./etc/ci/bencher.py filesize target/release/servo --bmf-output size.json
- name: Speedometer
run: |
python3 ./mach test-speedometer -r --bmf-output speedometer.json
- name: Dromaeo
run: |
python3 ./mach test-dromaeo -r dom --bmf-output dromaeo.json
# set options
- name: Set bencher opts for PRs (label try run)
if: github.event_name == 'pull_request_target'
run: |
echo "RUN_BENCHER_OPTIONS=--branch ${{ github.event.number }}/PR \
--branch-start-point ${{ github.base_ref }} \
--branch-start-point-hash ${{ github.event.pull_request.base.sha }} \
--branch-reset \
--github-actions ${{ secrets.GITHUB_TOKEN }}" >> "$GITHUB_ENV"
- name: Set bencher opts for main
if: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
run: |
echo "RUN_BENCHER_OPTIONS=--branch main \
--github-actions ${{ secrets.GITHUB_TOKEN }}" >> "$GITHUB_ENV"
- name: Set bencher opts for try branch
if: ${{ github.event_name == 'push' && github.ref_name == 'try' }}
run: |
git remote add upstream https://github.com/servo/servo
git fetch upstream main
echo "RUN_BENCHER_OPTIONS=--branch try \
--github-actions ${{ secrets.GITHUB_TOKEN }} \
--hash $(git rev-parse HEAD~1) \
--branch-start-point main \
--branch-start-point-hash $(git merge-base upstream/main HEAD) \
--branch-reset" >> "$GITHUB_ENV"
# we join results and send all data once to have it all in one report
- name: Send results
continue-on-error: true
run: |
./etc/ci/bencher.py merge size.json speedometer.json dromaeo.json --bmf-output b.json
bencher run --adapter json --file b.json \
--project ${{ env.BENCHER_PROJECT }} --token ${{ secrets.BENCHER_API_TOKEN }} --testbed ubuntu-22.04 \
$RUN_BENCHER_OPTIONS

View file

@ -32,6 +32,10 @@ on:
required: false
type: boolean
default: false
bencher:
required: false
default: false
type: boolean
workflow_dispatch:
inputs:
profile:
@ -63,6 +67,10 @@ on:
required: false
type: boolean
default: false
bencher:
required: false
default: false
type: boolean
env:
RUST_BACKTRACE: 1
@ -219,3 +227,10 @@ jobs:
wpt-sync-from-upstream: ${{ inputs.wpt-sync-from-upstream }}
wpt-layout: "layout-2013"
secrets: inherit
bencher:
needs: ["build"]
# benches must be release (we will do benches for production profile in servo/servo-nightly-builds)
if: ${{ inputs.bencher && inputs.profile == 'release' && github.event_name != 'workflow_dispatch' && github.event_name != 'merge_queue' }}
uses: ./.github/workflows/linux-bencher.yml
secrets: inherit

View file

@ -54,6 +54,7 @@ jobs:
profile: ${{ matrix.profile }}
unit-tests: ${{ matrix.unit_tests }}
wpt-args: ${{ matrix.wpt_args }}
bencher: ${{ matrix.bencher }}
build-result:
name: Result

View file

@ -137,6 +137,7 @@ jobs:
profile: ${{ matrix.profile }}
unit-tests: ${{ matrix.unit_tests }}
wpt-args: ${{ matrix.wpt_args }}
bencher: ${{ matrix.bencher }}
results:
name: Results

View file

@ -21,6 +21,9 @@ on:
unit-tests:
required: false
type: boolean
bencher:
required: false
type: boolean
jobs:
decision:
@ -104,6 +107,7 @@ jobs:
profile: ${{ matrix.profile }}
unit-tests: ${{ matrix.unit_tests }}
wpt-args: ${{ matrix.wpt_args }}
bencher: ${{ matrix.bencher }}
build-result:
name: Result