OHOS CI: Robustness of speedometer (#37830)

OHOS CI: If speedometer does not finish we currently abort the whole
job.
This fixes this behaviour by adding an emtpy file and continuing the
job.

Runs with errors will now look like this. Notice annotation.
https://github.com/Narfinger/servo/actions/runs/16026933009

Successful run:
https://github.com/Narfinger/servo/actions/runs/16027530625

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>

Testing: Tested on CI.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
This commit is contained in:
Narfinger 2025-07-02 23:48:47 +09:00 committed by GitHub
parent 5f0bbce9d2
commit afdd9778e5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -25,13 +25,12 @@ on:
default: "release" default: "release"
type: choice type: choice
description: "Cargo build profile" description: "Cargo build profile"
options: [ "release", "debug", "production"] options: ["release", "debug", "production"]
bencher: bencher:
required: false required: false
default: false default: false
type: boolean type: boolean
env: env:
RUST_BACKTRACE: 1 RUST_BACKTRACE: 1
SHELL: /bin/bash SHELL: /bin/bash
@ -44,7 +43,7 @@ jobs:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
strategy: strategy:
matrix: matrix:
target: ['aarch64-unknown-linux-ohos', 'x86_64-unknown-linux-ohos'] target: ["aarch64-unknown-linux-ohos", "x86_64-unknown-linux-ohos"]
outputs: outputs:
signed: ${{ steps.signing_config.outputs.signed }} signed: ${{ steps.signing_config.outputs.signed }}
steps: steps:
@ -138,7 +137,7 @@ jobs:
needs: ["build"] needs: ["build"]
strategy: strategy:
matrix: matrix:
target: ['aarch64-unknown-linux-ohos', 'x86_64-unknown-linux-ohos'] target: ["aarch64-unknown-linux-ohos", "x86_64-unknown-linux-ohos"]
if: ${{ inputs.bencher && inputs.profile != 'debug' && github.event_name != 'workflow_dispatch' && github.event_name != 'merge_group' }} if: ${{ inputs.bencher && inputs.profile != 'debug' && github.event_name != 'workflow_dispatch' && github.event_name != 'merge_group' }}
uses: ./.github/workflows/bencher.yml uses: ./.github/workflows/bencher.yml
with: with:
@ -206,7 +205,7 @@ jobs:
- name: Test loading servo.org - name: Test loading servo.org
env: env:
TRACE_BUFFER_SZ_KB: "524288" # 512 MB TRACE_BUFFER_SZ_KB: "524288" # 512 MB
run: | run: |
mkdir test_output mkdir test_output
hdc shell aa force-stop org.servo.servo hdc shell aa force-stop org.servo.servo
# Hitrace allows us to save application and system traces, which is useful to analyze performance. # Hitrace allows us to save application and system traces, which is useful to analyze performance.
@ -279,8 +278,14 @@ jobs:
uses: ./.github/actions/setup-python uses: ./.github/actions/setup-python
- name: "Run benchmark" - name: "Run benchmark"
run: hitrace-bench -r support/hitrace-bencher/runs.json run: hitrace-bench -r support/hitrace-bencher/runs.json
continue-on-error: true
- name: Run speedometer - name: Run speedometer
id: BencherRun
run: python3 ./mach test-speedometer-ohos --bmf-output speedometer.json run: python3 ./mach test-speedometer-ohos --bmf-output speedometer.json
continue-on-error: true
- name: Create empty speedometer.json if failed
run: touch speedometer.json
if: ${{ steps.BencherRun.outcome == 'failure' }}
- name: Getting model name - name: Getting model name
run: | run: |
echo "MODEL_NAME=$(hdc bugreport | head -n 20 | grep MarketName | awk '{for (i=2; i<NF; i++) printf $i " "; print $NF}' -)" >> $GITHUB_ENV echo "MODEL_NAME=$(hdc bugreport | head -n 20 | grep MarketName | awk '{for (i=2; i<NF; i++) printf $i " "; print $NF}' -)" >> $GITHUB_ENV
@ -288,7 +293,7 @@ jobs:
run: jq --compact-output --slurp add speedometer.json bench.json > combined-bencher.json run: jq --compact-output --slurp add speedometer.json bench.json > combined-bencher.json
- uses: bencherdev/bencher@main - uses: bencherdev/bencher@main
- name: Uploading to bencher.dev - name: Uploading to bencher.dev
run: | run: |
bencher run --adapter json \ bencher run --adapter json \
--file combined-bencher.json \ --file combined-bencher.json \
--project '${{ env.BENCHER_PROJECT }}' \ --project '${{ env.BENCHER_PROJECT }}' \
@ -296,4 +301,9 @@ jobs:
--token '${{ secrets.BENCHER_API_TOKEN }}' \ --token '${{ secrets.BENCHER_API_TOKEN }}' \
--github-actions '${{ secrets.GITHUB_TOKEN }}' \ --github-actions '${{ secrets.GITHUB_TOKEN }}' \
--testbed="$MODEL_NAME" --testbed="$MODEL_NAME"
- name: Success
if: ${{ !contains(steps.*.outcome, 'failure') && !contains(steps.*.outcome, 'cancelled') }}
run: exit 0
- name: Failure
if: contains(steps.*.outcome, 'failure') || contains(steps.*.outcome, 'cancelled')
run: exit 1