mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
feat: Track the binary size for all the different platforms (#34744)
* feat: Track the binary size for all the different platforms Signed-off-by: DK Liao <dklassic@gmail.com> * Add target to bencher job name Signed-off-by: DK Liao <dklassic@gmail.com> * Update .github/workflows/bencher.yml Co-authored-by: Martin Robinson <mrobinson@igalia.com> Signed-off-by: DK Liao <dklassic@gmail.com> --------- Signed-off-by: DK Liao <dklassic@gmail.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
c070372d1e
commit
9ceb957dd8
11 changed files with 365 additions and 153 deletions
30
.github/workflows/android.yml
vendored
30
.github/workflows/android.yml
vendored
|
@ -13,6 +13,11 @@ on:
|
||||||
github-release-id:
|
github-release-id:
|
||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
|
bencher:
|
||||||
|
required: false
|
||||||
|
default: false
|
||||||
|
type: boolean
|
||||||
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
profile:
|
profile:
|
||||||
|
@ -20,6 +25,11 @@ on:
|
||||||
default: "release"
|
default: "release"
|
||||||
type: choice
|
type: choice
|
||||||
options: ["release", "debug", "production"]
|
options: ["release", "debug", "production"]
|
||||||
|
bencher:
|
||||||
|
required: false
|
||||||
|
default: false
|
||||||
|
type: boolean
|
||||||
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
RUST_BACKTRACE: 1
|
RUST_BACKTRACE: 1
|
||||||
|
@ -104,7 +114,7 @@ jobs:
|
||||||
- name: Archive build timing
|
- name: Archive build timing
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: cargo-timings-android-${{ matrix.target }}
|
name: cargo-timings-android-${{ matrix.target }}-${{ inputs.profile }}
|
||||||
# Using a wildcard here ensures that the archive includes the path.
|
# Using a wildcard here ensures that the archive includes the path.
|
||||||
path: target/cargo-timings-*
|
path: target/cargo-timings-*
|
||||||
- name: Upload nightly
|
- name: Upload nightly
|
||||||
|
@ -137,3 +147,21 @@ jobs:
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.profile }}-library-android-${{ matrix.target }}
|
name: ${{ inputs.profile }}-library-android-${{ matrix.target }}
|
||||||
path: target/android/${{ matrix.target }}/${{ inputs.profile }}/servoview.aar
|
path: target/android/${{ matrix.target }}/${{ inputs.profile }}/servoview.aar
|
||||||
|
|
||||||
|
bencher:
|
||||||
|
needs: ["build"]
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
target: ['aarch64-linux-android', 'armv7-linux-androideabi', 'i686-linux-android', 'x86_64-linux-android']
|
||||||
|
if: ${{ inputs.bencher && inputs.profile != 'debug' && github.event_name != 'workflow_dispatch' && github.event_name != 'merge_group' }}
|
||||||
|
name: 'Bencher (${{ matrix.target }})'
|
||||||
|
uses: ./.github/workflows/bencher.yml
|
||||||
|
with:
|
||||||
|
target: android-${{ matrix.target }}
|
||||||
|
profile: ${{ inputs.profile }}
|
||||||
|
compressed-file-path: ${{ inputs.profile }}-binary-android-${{ matrix.target }}/servoapp.apk
|
||||||
|
binary-path: lib/${{ matrix.target == 'aarch64-linux-android' && 'arm64-v8a' || matrix.target == 'armv7-linux-androideabi' && 'armeabi-v7a' || matrix.target == 'i686-linux-android' && 'x86' || matrix.target == 'x86_64-linux-android' && 'x86_64'}}/libservoshell.so
|
||||||
|
file-size: true
|
||||||
|
speedometer: false
|
||||||
|
dromaeo: false
|
||||||
|
secrets: inherit
|
147
.github/workflows/bencher.yml
vendored
Normal file
147
.github/workflows/bencher.yml
vendored
Normal file
|
@ -0,0 +1,147 @@
|
||||||
|
name: Bencher
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
target:
|
||||||
|
required: false
|
||||||
|
default: "linux"
|
||||||
|
type: string
|
||||||
|
profile:
|
||||||
|
required: false
|
||||||
|
default: "release"
|
||||||
|
type: string
|
||||||
|
compressed-file-path:
|
||||||
|
required: false
|
||||||
|
default: ""
|
||||||
|
type: string
|
||||||
|
binary-path:
|
||||||
|
required: false
|
||||||
|
default: ""
|
||||||
|
type: string
|
||||||
|
file-size:
|
||||||
|
required: false
|
||||||
|
default: false
|
||||||
|
type: boolean
|
||||||
|
stripped-file-size:
|
||||||
|
required: false
|
||||||
|
default: false
|
||||||
|
type: boolean
|
||||||
|
speedometer:
|
||||||
|
required: false
|
||||||
|
default: false
|
||||||
|
type: boolean
|
||||||
|
dromaeo:
|
||||||
|
required: false
|
||||||
|
default: false
|
||||||
|
type: boolean
|
||||||
|
|
||||||
|
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:
|
||||||
|
bencher:
|
||||||
|
name: Bencher (${{ inputs.target }})
|
||||||
|
# This needs to be kept in sync with the `--testbed` argument sent to bencher.
|
||||||
|
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: ${{ inputs.profile }}-binary-${{ inputs.target }}
|
||||||
|
path: ${{ inputs.profile }}-binary-${{ inputs.target }}
|
||||||
|
# Linux and macOS uploads compressed binary, need to extract first
|
||||||
|
- name: unPackage binary (tar)
|
||||||
|
if: ${{ inputs.compressed-file-path != '' && contains(inputs.compressed-file-path, '.tar.gz') }}
|
||||||
|
run: tar -xzf ${{ inputs.compressed-file-path }}
|
||||||
|
- name: unPackage binary (unzip)
|
||||||
|
if: ${{ inputs.compressed-file-path != '' && !contains(inputs.compressed-file-path, '.tar.gz') }}
|
||||||
|
run: unzip ${{ inputs.compressed-file-path }}
|
||||||
|
- name: Setup Python
|
||||||
|
uses: ./.github/actions/setup-python
|
||||||
|
- name: Bootstrap dependencies
|
||||||
|
if: ${{ inputs.speedometer == true || inputs.dromaeo == true }}
|
||||||
|
run: |
|
||||||
|
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
|
||||||
|
if: ${{ inputs.file-size == true }}
|
||||||
|
run: |
|
||||||
|
./etc/ci/bencher.py filesize ${{ inputs.binary-path }} ${{ inputs.target }}-${{ inputs.profile }} --bmf-output size.json
|
||||||
|
echo "SERVO_FILE_SIZE_RESULT=size.json" >> "$GITHUB_ENV"
|
||||||
|
# We'll additionally strip and measure the size of the binary when using production profile
|
||||||
|
- name: Install LLVM
|
||||||
|
if: ${{ inputs.file-size == true && inputs.profile == 'production' }}
|
||||||
|
uses: KyleMayes/install-llvm-action@v2
|
||||||
|
with:
|
||||||
|
version: "17"
|
||||||
|
- name: Install llvm-strip dependency
|
||||||
|
if: ${{ inputs.file-size == true && inputs.profile == 'production' }}
|
||||||
|
run: sudo apt install libncurses5
|
||||||
|
- name: File size (llvm stripped)
|
||||||
|
if: ${{ inputs.file-size == true && inputs.profile == 'production' }}
|
||||||
|
run: |
|
||||||
|
llvm-strip ${{ inputs.binary-path }}
|
||||||
|
./etc/ci/bencher.py filesize ${{ inputs.binary-path }} ${{ inputs.target }}-${{ inputs.profile }}-stripped --bmf-output size-stripped.json
|
||||||
|
echo "SERVO_STRIPPED_FILE_SIZE_RESULT=size-stripped.json" >> "$GITHUB_ENV"
|
||||||
|
- name: Speedometer
|
||||||
|
if: ${{ inputs.speedometer == true }}
|
||||||
|
run: |
|
||||||
|
python3 ./mach test-speedometer -r --bmf-output speedometer.json
|
||||||
|
echo "SERVO_SPEEDOMETER_RESULT=speedometer.json" >> "$GITHUB_ENV"
|
||||||
|
- name: Dromaeo
|
||||||
|
if: ${{ inputs.dromaeo == true }}
|
||||||
|
run: |
|
||||||
|
python3 ./mach test-dromaeo -r dom --bmf-output dromaeo.json
|
||||||
|
echo "SERVO_DROMAEO_RESULT=dromaeo.json" >> "$GITHUB_ENV"
|
||||||
|
# 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 ${{ env.SERVO_FILE_SIZE_RESULT }} ${{ env.SERVO_STRIPPED_FILE_SIZE_RESULT }} ${{ env.SERVO_SPEEDOMETER_RESULT }} ${{ env.SERVO_DROMAEO_RESULT }} --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
|
5
.github/workflows/dispatch-workflow.yml
vendored
5
.github/workflows/dispatch-workflow.yml
vendored
|
@ -30,6 +30,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
profile: ${{ inputs.profile }}
|
profile: ${{ inputs.profile }}
|
||||||
unit-tests: ${{ inputs.unit-tests }}
|
unit-tests: ${{ inputs.unit-tests }}
|
||||||
|
bencher: ${{ inputs.bencher }}
|
||||||
|
|
||||||
macos:
|
macos:
|
||||||
if: ${{ inputs.workflow == 'macos' }}
|
if: ${{ inputs.workflow == 'macos' }}
|
||||||
|
@ -41,6 +42,7 @@ jobs:
|
||||||
wpt-layout: ${{ inputs.wpt-layout }}
|
wpt-layout: ${{ inputs.wpt-layout }}
|
||||||
unit-tests: ${{ inputs.unit-tests }}
|
unit-tests: ${{ inputs.unit-tests }}
|
||||||
wpt-args: ${{ inputs.wpt-args }}
|
wpt-args: ${{ inputs.wpt-args }}
|
||||||
|
bencher: ${{ inputs.bencher }}
|
||||||
|
|
||||||
linux:
|
linux:
|
||||||
if: ${{ inputs.workflow == 'linux' }}
|
if: ${{ inputs.workflow == 'linux' }}
|
||||||
|
@ -67,10 +69,13 @@ jobs:
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
with:
|
with:
|
||||||
profile: ${{ inputs.profile }}
|
profile: ${{ inputs.profile }}
|
||||||
|
bencher: ${{ inputs.bencher }}
|
||||||
|
|
||||||
ohos:
|
ohos:
|
||||||
if: ${{ inputs.workflow == 'ohos' }}
|
if: ${{ inputs.workflow == 'ohos' }}
|
||||||
name: OpenHarmony
|
name: OpenHarmony
|
||||||
uses: ./.github/workflows/ohos.yml
|
uses: ./.github/workflows/ohos.yml
|
||||||
|
secrets: inherit
|
||||||
with:
|
with:
|
||||||
profile: ${{ inputs.profile }}
|
profile: ${{ inputs.profile }}
|
||||||
|
bencher: ${{ inputs.bencher }}
|
||||||
|
|
86
.github/workflows/linux-bencher.yml
vendored
86
.github/workflows/linux-bencher.yml
vendored
|
@ -1,86 +0,0 @@
|
||||||
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: Setup Python
|
|
||||||
uses: ./.github/actions/setup-python
|
|
||||||
- name: Bootstrap dependencies
|
|
||||||
run: |
|
|
||||||
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
|
|
18
.github/workflows/linux.yml
vendored
18
.github/workflows/linux.yml
vendored
|
@ -168,7 +168,7 @@ jobs:
|
||||||
- name: Archive build timing
|
- name: Archive build timing
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: cargo-timings-linux
|
name: cargo-timings-linux-${{ inputs.profile }}
|
||||||
# Using a wildcard here ensures that the archive includes the path.
|
# Using a wildcard here ensures that the archive includes the path.
|
||||||
path: target/cargo-timings-*
|
path: target/cargo-timings-*
|
||||||
- name: Build mach package
|
- name: Build mach package
|
||||||
|
@ -176,7 +176,7 @@ jobs:
|
||||||
- name: Upload artifact for mach package
|
- name: Upload artifact for mach package
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: linux
|
name: linux-${{ inputs.profile }}
|
||||||
path: target/${{ inputs.profile }}/servo-tech-demo.tar.gz
|
path: target/${{ inputs.profile }}/servo-tech-demo.tar.gz
|
||||||
- name: Upload nightly
|
- name: Upload nightly
|
||||||
if: ${{ inputs.upload }}
|
if: ${{ inputs.upload }}
|
||||||
|
@ -222,7 +222,15 @@ jobs:
|
||||||
|
|
||||||
bencher:
|
bencher:
|
||||||
needs: ["build"]
|
needs: ["build"]
|
||||||
# benches must be release (we will do benches for production profile in servo/servo-nightly-builds)
|
if: ${{ inputs.bencher && inputs.profile != 'debug' && github.event_name != 'workflow_dispatch' && github.event_name != 'merge_group' }}
|
||||||
if: ${{ inputs.bencher && inputs.profile == 'release' && github.event_name != 'workflow_dispatch' && github.event_name != 'merge_group' }}
|
uses: ./.github/workflows/bencher.yml
|
||||||
uses: ./.github/workflows/linux-bencher.yml
|
with:
|
||||||
|
target: 'linux'
|
||||||
|
profile: ${{ inputs.profile }}
|
||||||
|
compressed-file-path: ${{ inputs.profile }}-binary-linux/target.tar.gz
|
||||||
|
binary-path: target/${{ inputs.profile }}/servo
|
||||||
|
file-size: true
|
||||||
|
# We only evaluate speedometer and dromaeo score in release
|
||||||
|
speedometer: ${{ inputs.profile == 'release' }}
|
||||||
|
dromaeo: ${{ inputs.profile == 'release' }}
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
30
.github/workflows/mac.yml
vendored
30
.github/workflows/mac.yml
vendored
|
@ -26,9 +26,13 @@ on:
|
||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
force-github-hosted-runner:
|
force-github-hosted-runner:
|
||||||
|
required: false
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
bencher:
|
||||||
required: false
|
required: false
|
||||||
type: boolean
|
|
||||||
default: false
|
default: false
|
||||||
|
type: boolean
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
profile:
|
profile:
|
||||||
|
@ -53,9 +57,13 @@ on:
|
||||||
default: false
|
default: false
|
||||||
type: boolean
|
type: boolean
|
||||||
force-github-hosted-runner:
|
force-github-hosted-runner:
|
||||||
|
required: false
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
bencher:
|
||||||
required: false
|
required: false
|
||||||
type: boolean
|
|
||||||
default: false
|
default: false
|
||||||
|
type: boolean
|
||||||
|
|
||||||
env:
|
env:
|
||||||
RUST_BACKTRACE: 1
|
RUST_BACKTRACE: 1
|
||||||
|
@ -155,13 +163,13 @@ jobs:
|
||||||
- name: Archive build timing
|
- name: Archive build timing
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: cargo-timings-macos
|
name: cargo-timings-macos-${{ inputs.profile }}
|
||||||
# Using a wildcard here ensures that the archive includes the path.
|
# Using a wildcard here ensures that the archive includes the path.
|
||||||
path: target/cargo-timings-*
|
path: target/cargo-timings-*
|
||||||
- name: Upload artifact for mach package
|
- name: Upload artifact for mach package
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: mac
|
name: ${{ inputs.profile }}-binary-mac
|
||||||
path: target/${{ inputs.profile }}/servo-tech-demo.dmg
|
path: target/${{ inputs.profile }}/servo-tech-demo.dmg
|
||||||
- name: Upload nightly
|
- name: Upload nightly
|
||||||
if: ${{ inputs.upload }}
|
if: ${{ inputs.upload }}
|
||||||
|
@ -202,3 +210,17 @@ jobs:
|
||||||
wpt-layout: "layout-2013"
|
wpt-layout: "layout-2013"
|
||||||
wpt-args: ${{ inputs.wpt-args }}
|
wpt-args: ${{ inputs.wpt-args }}
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
||||||
|
bencher:
|
||||||
|
needs: ["build"]
|
||||||
|
if: ${{ inputs.bencher && inputs.profile != 'debug' && github.event_name != 'workflow_dispatch' && github.event_name != 'merge_group' }}
|
||||||
|
uses: ./.github/workflows/bencher.yml
|
||||||
|
with:
|
||||||
|
target: 'macos'
|
||||||
|
profile: ${{ inputs.profile }}
|
||||||
|
compressed-file-path: ${{ inputs.profile }}-binary-macos/target.tar.gz
|
||||||
|
binary-path: target/${{ inputs.profile }}/servo
|
||||||
|
file-size: true
|
||||||
|
speedometer: false
|
||||||
|
dromaeo: false
|
||||||
|
secrets: inherit
|
||||||
|
|
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
|
@ -35,7 +35,7 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
{
|
{
|
||||||
echo 'result<<EOF'
|
echo 'result<<EOF'
|
||||||
python ./python/servo/try_parser.py ${{ github.event_name == 'pull_request' && 'linux lint' || 'fail-fast full' }}
|
python ./python/servo/try_parser.py ${{ github.event_name == 'pull_request' && 'linux-unit-tests lint' || github.event_name == 'push' && 'fail-fast full bencher production-bencher' || 'fail-fast full' }}
|
||||||
echo EOF
|
echo EOF
|
||||||
} >> $GITHUB_OUTPUT
|
} >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
|
33
.github/workflows/ohos.yml
vendored
33
.github/workflows/ohos.yml
vendored
|
@ -13,6 +13,11 @@ on:
|
||||||
github-release-id:
|
github-release-id:
|
||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
|
bencher:
|
||||||
|
required: false
|
||||||
|
default: false
|
||||||
|
type: boolean
|
||||||
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
profile:
|
profile:
|
||||||
|
@ -21,6 +26,11 @@ on:
|
||||||
type: choice
|
type: choice
|
||||||
description: "Cargo build profile"
|
description: "Cargo build profile"
|
||||||
options: [ "release", "debug", "production"]
|
options: [ "release", "debug", "production"]
|
||||||
|
bencher:
|
||||||
|
required: false
|
||||||
|
default: false
|
||||||
|
type: boolean
|
||||||
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
RUST_BACKTRACE: 1
|
RUST_BACKTRACE: 1
|
||||||
|
@ -34,6 +44,8 @@ jobs:
|
||||||
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:
|
||||||
|
signed: $${{ steps.signing-config.outputs.signed }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
if: github.event_name != 'pull_request_target'
|
if: github.event_name != 'pull_request_target'
|
||||||
|
@ -70,6 +82,7 @@ jobs:
|
||||||
npm install "@ohos/hvigor@5" "@ohos/hvigor-ohos-plugin@5"
|
npm install "@ohos/hvigor@5" "@ohos/hvigor-ohos-plugin@5"
|
||||||
echo "HVIGOR_PATH=$PWD" >> $GITHUB_ENV
|
echo "HVIGOR_PATH=$PWD" >> $GITHUB_ENV
|
||||||
- name: "Setup HAP signing config"
|
- name: "Setup HAP signing config"
|
||||||
|
id: signing-config
|
||||||
env:
|
env:
|
||||||
SIGNING_MATERIAL: ${{ secrets.SERVO_OHOS_SIGNING_MATERIAL }}
|
SIGNING_MATERIAL: ${{ secrets.SERVO_OHOS_SIGNING_MATERIAL }}
|
||||||
if: ${{ inputs.upload || env.SIGNING_MATERIAL != '' }} # Allows the build to pass on forks.
|
if: ${{ inputs.upload || env.SIGNING_MATERIAL != '' }} # Allows the build to pass on forks.
|
||||||
|
@ -78,6 +91,7 @@ jobs:
|
||||||
echo "${SIGNING_MATERIAL}" | base64 -d > servo-ohos-material.zip
|
echo "${SIGNING_MATERIAL}" | base64 -d > servo-ohos-material.zip
|
||||||
unzip servo-ohos-material.zip
|
unzip servo-ohos-material.zip
|
||||||
echo "SERVO_OHOS_SIGNING_CONFIG=${PWD}/servo-ohos-material/signing-configs.json" >> $GITHUB_ENV
|
echo "SERVO_OHOS_SIGNING_CONFIG=${PWD}/servo-ohos-material/signing-configs.json" >> $GITHUB_ENV
|
||||||
|
echo "signed=true" >> "$GITHUB_OUTPUT"
|
||||||
- name: Build (arch ${{ matrix.target }} profile ${{ inputs.profile }})
|
- name: Build (arch ${{ matrix.target }} profile ${{ inputs.profile }})
|
||||||
env:
|
env:
|
||||||
OHOS_SDK_NATIVE: ${{ steps.setup_sdk.outputs.ohos_sdk_native }}
|
OHOS_SDK_NATIVE: ${{ steps.setup_sdk.outputs.ohos_sdk_native }}
|
||||||
|
@ -88,7 +102,7 @@ jobs:
|
||||||
- name: Archive build timing
|
- name: Archive build timing
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: cargo-timings-ohos-${{ matrix.target }}
|
name: cargo-timings-ohos-${{ matrix.target }}-${{ inputs.profile }}
|
||||||
# Using a wildcard here ensures that the archive includes the path.
|
# Using a wildcard here ensures that the archive includes the path.
|
||||||
path: target/cargo-timings-*
|
path: target/cargo-timings-*
|
||||||
- name: Upload nightly
|
- name: Upload nightly
|
||||||
|
@ -118,3 +132,20 @@ jobs:
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.profile }}-binary-ohos-${{ matrix.target }}
|
name: ${{ inputs.profile }}-binary-ohos-${{ matrix.target }}
|
||||||
path: target/openharmony/${{ matrix.target }}/${{ inputs.profile }}/entry/build/default/outputs/default/servoshell-default-unsigned.hap
|
path: target/openharmony/${{ matrix.target }}/${{ inputs.profile }}/entry/build/default/outputs/default/servoshell-default-unsigned.hap
|
||||||
|
|
||||||
|
bencher:
|
||||||
|
needs: ["build"]
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
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' }}
|
||||||
|
uses: ./.github/workflows/bencher.yml
|
||||||
|
with:
|
||||||
|
target: ohos-${{ matrix.target }}
|
||||||
|
profile: ${{ inputs.profile }}
|
||||||
|
compressed-file-path: ${{ inputs.profile }}-binary-ohos-${{ matrix.target }}/servoshell-default-${{ needs.build.outputs.signed == true && 'signed' || 'unsigned' }}.hap
|
||||||
|
binary-path: libs/${{ matrix.target == 'aarch64-unknown-linux-ohos' && 'arm64-v8a' || matrix.target == 'x86_64-unknown-linux-ohos' && 'x86_64' }}/libservoshell.so
|
||||||
|
file-size: true
|
||||||
|
speedometer: false
|
||||||
|
dromaeo: false
|
||||||
|
secrets: inherit
|
25
.github/workflows/windows.yml
vendored
25
.github/workflows/windows.yml
vendored
|
@ -22,6 +22,10 @@ on:
|
||||||
required: false
|
required: false
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
|
bencher:
|
||||||
|
required: false
|
||||||
|
default: false
|
||||||
|
type: boolean
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
profile:
|
profile:
|
||||||
|
@ -41,6 +45,10 @@ on:
|
||||||
required: false
|
required: false
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
|
bencher:
|
||||||
|
required: false
|
||||||
|
default: false
|
||||||
|
type: boolean
|
||||||
|
|
||||||
env:
|
env:
|
||||||
RUST_BACKTRACE: 1
|
RUST_BACKTRACE: 1
|
||||||
|
@ -163,7 +171,7 @@ jobs:
|
||||||
- name: Archive build timing
|
- name: Archive build timing
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: cargo-timings-windows
|
name: cargo-timings-windows-${{ inputs.profile }}
|
||||||
# Using a wildcard here ensures that the archive includes the path.
|
# Using a wildcard here ensures that the archive includes the path.
|
||||||
path: C:\\a\\servo\\servo\\target\\cargo-timings-*
|
path: C:\\a\\servo\\servo\\target\\cargo-timings-*
|
||||||
- name: Build mach package
|
- name: Build mach package
|
||||||
|
@ -171,7 +179,7 @@ jobs:
|
||||||
- name: Upload artifact for mach package
|
- name: Upload artifact for mach package
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: win
|
name: ${{ inputs.profile }}-binary-windows
|
||||||
# These files are available
|
# These files are available
|
||||||
# MSI Installer: C:\a\servo\servo\target\${{ inputs.profile }}\msi\Installer.msi
|
# MSI Installer: C:\a\servo\servo\target\${{ inputs.profile }}\msi\Installer.msi
|
||||||
# Bundle: C:\a\servo\servo\target\${{ inputs.profile }}\msi\Servo.exe
|
# Bundle: C:\a\servo\servo\target\${{ inputs.profile }}\msi\Servo.exe
|
||||||
|
@ -186,3 +194,16 @@ jobs:
|
||||||
S3_UPLOAD_CREDENTIALS: ${{ secrets.S3_UPLOAD_CREDENTIALS }}
|
S3_UPLOAD_CREDENTIALS: ${{ secrets.S3_UPLOAD_CREDENTIALS }}
|
||||||
NIGHTLY_REPO_TOKEN: ${{ secrets.NIGHTLY_REPO_TOKEN }}
|
NIGHTLY_REPO_TOKEN: ${{ secrets.NIGHTLY_REPO_TOKEN }}
|
||||||
NIGHTLY_REPO: ${{ github.repository_owner }}/servo-nightly-builds
|
NIGHTLY_REPO: ${{ github.repository_owner }}/servo-nightly-builds
|
||||||
|
bencher:
|
||||||
|
needs: ["build"]
|
||||||
|
if: ${{ inputs.bencher && inputs.profile != 'debug' && github.event_name != 'workflow_dispatch' && github.event_name != 'merge_group' }}
|
||||||
|
uses: ./.github/workflows/bencher.yml
|
||||||
|
with:
|
||||||
|
target: 'windows'
|
||||||
|
profile: ${{ inputs.profile }}
|
||||||
|
compressed-file-path: ''
|
||||||
|
binary-path: ${{ inputs.profile }}-binary-windows/Servo.exe
|
||||||
|
file-size: true
|
||||||
|
speedometer: false
|
||||||
|
dromaeo: false
|
||||||
|
secrets: inherit
|
||||||
|
|
|
@ -19,7 +19,7 @@ def size(args):
|
||||||
print(size)
|
print(size)
|
||||||
with open(args.bmf_output, 'w', encoding='utf-8') as f:
|
with open(args.bmf_output, 'w', encoding='utf-8') as f:
|
||||||
json.dump({
|
json.dump({
|
||||||
'servo': {
|
args.variant: {
|
||||||
'file-size': {
|
'file-size': {
|
||||||
'value': float(size),
|
'value': float(size),
|
||||||
}
|
}
|
||||||
|
@ -46,6 +46,7 @@ parser = argparse.ArgumentParser("Helper commands for bencher")
|
||||||
subparser = parser.add_subparsers()
|
subparser = parser.add_subparsers()
|
||||||
size_parser = subparser.add_parser("filesize", help="Returns BMF for filesize")
|
size_parser = subparser.add_parser("filesize", help="Returns BMF for filesize")
|
||||||
size_parser.add_argument("binary", help="Servo binary file")
|
size_parser.add_argument("binary", help="Servo binary file")
|
||||||
|
size_parser.add_argument("variant", help="variant of the binary")
|
||||||
size_parser.add_argument("--bmf-output", help="BMF JSON output file", default=None)
|
size_parser.add_argument("--bmf-output", help="BMF JSON output file", default=None)
|
||||||
size_parser.set_defaults(func=size)
|
size_parser.set_defaults(func=size)
|
||||||
|
|
||||||
|
|
|
@ -73,54 +73,78 @@ class JobConfig(object):
|
||||||
self.wpt_layout |= other.wpt_layout
|
self.wpt_layout |= other.wpt_layout
|
||||||
self.unit_tests |= other.unit_tests
|
self.unit_tests |= other.unit_tests
|
||||||
self.bencher |= other.bencher
|
self.bencher |= other.bencher
|
||||||
common = min([self.name, other.name], key=len)
|
self.update_name()
|
||||||
p1 = self.name.strip(common).strip()
|
|
||||||
p2 = other.name.strip(common).strip()
|
|
||||||
self.name = common.strip()
|
|
||||||
if p1:
|
|
||||||
self.name += f" {p1}"
|
|
||||||
if p2:
|
|
||||||
self.name += f" {p2}"
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
def update_name(self):
|
||||||
|
if self.workflow is Workflow.LINUX:
|
||||||
|
self.name = "Linux"
|
||||||
|
elif self.workflow is Workflow.MACOS:
|
||||||
|
self.name = "MacOS"
|
||||||
|
elif self.workflow is Workflow.WINDOWS:
|
||||||
|
self.name = "Windows"
|
||||||
|
elif self.workflow is Workflow.ANDROID:
|
||||||
|
self.name = "Android"
|
||||||
|
elif self.workflow is Workflow.OHOS:
|
||||||
|
self.name = "OpenHarmony"
|
||||||
|
modifier = []
|
||||||
|
if self.profile != "release":
|
||||||
|
modifier.append(self.profile.title())
|
||||||
|
if self.unit_tests:
|
||||||
|
modifier.append("Unit Tests")
|
||||||
|
if self.wpt_layout != Layout.none:
|
||||||
|
modifier.append("WPT")
|
||||||
|
if self.bencher:
|
||||||
|
modifier.append("Bencher")
|
||||||
|
if modifier:
|
||||||
|
self.name += " (" + ", ".join(modifier) + ")"
|
||||||
|
|
||||||
|
|
||||||
def handle_preset(s: str) -> Optional[JobConfig]:
|
def handle_preset(s: str) -> Optional[JobConfig]:
|
||||||
s = s.lower()
|
s = s.lower()
|
||||||
|
|
||||||
if s == "linux":
|
if any(word in s for word in ["linux"]):
|
||||||
return JobConfig("Linux", Workflow.LINUX, unit_tests=True)
|
return JobConfig("Linux", Workflow.LINUX)
|
||||||
elif s in ["perf", "linux-perf", "bencher"]:
|
elif any(word in s for word in ["mac", "macos"]):
|
||||||
return JobConfig("Linux perf", Workflow.LINUX, bencher=True)
|
return JobConfig("MacOS", Workflow.MACOS)
|
||||||
elif s in ["mac", "macos"]:
|
elif any(word in s for word in ["win", "windows"]):
|
||||||
return JobConfig("MacOS", Workflow.MACOS, unit_tests=True)
|
return JobConfig("Windows", Workflow.WINDOWS)
|
||||||
elif s in ["win", "windows"]:
|
elif any(word in s for word in ["android"]):
|
||||||
return JobConfig("Windows", Workflow.WINDOWS, unit_tests=True)
|
|
||||||
elif s in ["wpt-2013", "linux-wpt-2013"]:
|
|
||||||
return JobConfig("Linux WPT", Workflow.LINUX, wpt_layout=Layout.layout2013)
|
|
||||||
elif s in ["wpt-2020", "linux-wpt-2020", "wpt", "linux-wpt"]:
|
|
||||||
return JobConfig("Linux WPT", Workflow.LINUX, wpt_layout=Layout.layout2020)
|
|
||||||
elif s in ["mac-wpt", "wpt-mac"]:
|
|
||||||
return JobConfig("MacOS WPT", Workflow.MACOS, wpt_layout=Layout.all())
|
|
||||||
elif s == "mac-wpt-2013":
|
|
||||||
return JobConfig("MacOS WPT", Workflow.MACOS, wpt_layout=Layout.layout2013)
|
|
||||||
elif s == "mac-wpt-2020":
|
|
||||||
return JobConfig("MacOS WPT", Workflow.MACOS, wpt_layout=Layout.layout2020)
|
|
||||||
elif s == "android":
|
|
||||||
return JobConfig("Android", Workflow.ANDROID)
|
return JobConfig("Android", Workflow.ANDROID)
|
||||||
elif s in ["ohos", "openharmony"]:
|
elif any(word in s for word in ["ohos", "openharmony"]):
|
||||||
return JobConfig("OpenHarmony", Workflow.OHOS)
|
return JobConfig("OpenHarmony", Workflow.OHOS)
|
||||||
elif s == "webgpu":
|
elif any(word in s for word in ["webgpu"]):
|
||||||
return JobConfig("WebGPU CTS", Workflow.LINUX,
|
return JobConfig("WebGPU CTS", Workflow.LINUX,
|
||||||
wpt_layout=Layout.layout2020, # reftests are mode for new layout
|
wpt_layout=Layout.layout2020, # reftests are mode for new layout
|
||||||
wpt_args="_webgpu", # run only webgpu cts
|
wpt_args="_webgpu", # run only webgpu cts
|
||||||
profile="production", # WebGPU works to slow with debug assert
|
profile="production", # WebGPU works to slow with debug assert
|
||||||
unit_tests=False) # production profile does not work with unit-tests
|
unit_tests=False) # production profile does not work with unit-tests
|
||||||
elif s in ["lint", "tidy"]:
|
elif any(word in s for word in ["lint", "tidy"]):
|
||||||
return JobConfig("Lint", Workflow.LINT)
|
return JobConfig("Lint", Workflow.LINT)
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def handle_modifier(config: JobConfig, s: str) -> Optional[JobConfig]:
|
||||||
|
if config is None:
|
||||||
|
return None
|
||||||
|
s = s.lower()
|
||||||
|
if "unit-tests" in s:
|
||||||
|
config.unit_tests = True
|
||||||
|
if "production" in s:
|
||||||
|
config.profile = "production"
|
||||||
|
if "bencher" in s:
|
||||||
|
config.bencher = True
|
||||||
|
if "wpt-2013" in s:
|
||||||
|
config.wpt_layout = Layout.layout2013
|
||||||
|
elif "wpt-2020" in s:
|
||||||
|
config.wpt_layout = Layout.layout2020
|
||||||
|
elif "wpt" in s:
|
||||||
|
config.wpt_layout = Layout.all()
|
||||||
|
config.update_name()
|
||||||
|
return config
|
||||||
|
|
||||||
|
|
||||||
class Encoder(json.JSONEncoder):
|
class Encoder(json.JSONEncoder):
|
||||||
def default(self, o):
|
def default(self, o):
|
||||||
if isinstance(o, (Config, JobConfig)):
|
if isinstance(o, (Config, JobConfig)):
|
||||||
|
@ -151,10 +175,18 @@ class Config(object):
|
||||||
self.fail_fast = True
|
self.fail_fast = True
|
||||||
continue # skip over keyword
|
continue # skip over keyword
|
||||||
if word == "full":
|
if word == "full":
|
||||||
words.extend(["linux", "linux-wpt", "linux-perf", "macos", "windows", "android", "ohos", "lint"])
|
words.extend(["linux-unit-tests", "linux-wpt-2020", "linux-bencher"])
|
||||||
|
words.extend(["macos-unit-tests", "windows-unit-tests", "android", "ohos", "lint"])
|
||||||
|
continue # skip over keyword
|
||||||
|
if word == "bencher":
|
||||||
|
words.extend(["linux-bencher", "macos-bencher", "windows-bencher", "android-bencher", "ohos-bencher"])
|
||||||
|
continue # skip over keyword
|
||||||
|
if word == "production-bencher":
|
||||||
|
words.extend(["linux-production-bencher", "macos-production-bencher", "windows-production-bencher"])
|
||||||
|
words.extend(["ohos-production-bencher"])
|
||||||
continue # skip over keyword
|
continue # skip over keyword
|
||||||
|
|
||||||
job = handle_preset(word)
|
job = handle_preset(word)
|
||||||
|
job = handle_modifier(job, word)
|
||||||
if job is None:
|
if job is None:
|
||||||
print(f"Ignoring unknown preset {word}")
|
print(f"Ignoring unknown preset {word}")
|
||||||
else:
|
else:
|
||||||
|
@ -181,11 +213,11 @@ if __name__ == "__main__":
|
||||||
|
|
||||||
class TestParser(unittest.TestCase):
|
class TestParser(unittest.TestCase):
|
||||||
def test_string(self):
|
def test_string(self):
|
||||||
self.assertDictEqual(json.loads(Config("linux fail-fast").to_json()),
|
self.assertDictEqual(json.loads(Config("linux-unit-tests fail-fast").to_json()),
|
||||||
{'fail_fast': True,
|
{'fail_fast': True,
|
||||||
'matrix': [{
|
'matrix': [{
|
||||||
'bencher': False,
|
'bencher': False,
|
||||||
'name': 'Linux',
|
'name': 'Linux (Unit Tests)',
|
||||||
'profile': 'release',
|
'profile': 'release',
|
||||||
'unit_tests': True,
|
'unit_tests': True,
|
||||||
'workflow': 'linux',
|
'workflow': 'linux',
|
||||||
|
@ -198,7 +230,7 @@ class TestParser(unittest.TestCase):
|
||||||
self.assertDictEqual(json.loads(Config("").to_json()),
|
self.assertDictEqual(json.loads(Config("").to_json()),
|
||||||
{"fail_fast": False, "matrix": [
|
{"fail_fast": False, "matrix": [
|
||||||
{
|
{
|
||||||
"name": "Linux WPT perf",
|
"name": "Linux (Unit Tests, WPT, Bencher)",
|
||||||
"workflow": "linux",
|
"workflow": "linux",
|
||||||
"wpt_layout": "2020",
|
"wpt_layout": "2020",
|
||||||
"profile": "release",
|
"profile": "release",
|
||||||
|
@ -207,7 +239,7 @@ class TestParser(unittest.TestCase):
|
||||||
"wpt_args": ""
|
"wpt_args": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "MacOS",
|
"name": "MacOS (Unit Tests)",
|
||||||
"workflow": "macos",
|
"workflow": "macos",
|
||||||
"wpt_layout": "none",
|
"wpt_layout": "none",
|
||||||
"profile": "release",
|
"profile": "release",
|
||||||
|
@ -216,7 +248,7 @@ class TestParser(unittest.TestCase):
|
||||||
"wpt_args": ""
|
"wpt_args": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Windows",
|
"name": "Windows (Unit Tests)",
|
||||||
"workflow": "windows",
|
"workflow": "windows",
|
||||||
"wpt_layout": "none",
|
"wpt_layout": "none",
|
||||||
"profile": "release",
|
"profile": "release",
|
||||||
|
@ -253,11 +285,11 @@ class TestParser(unittest.TestCase):
|
||||||
]})
|
]})
|
||||||
|
|
||||||
def test_job_merging(self):
|
def test_job_merging(self):
|
||||||
self.assertDictEqual(json.loads(Config("wpt-2020 wpt-2013").to_json()),
|
self.assertDictEqual(json.loads(Config("linux-wpt-2020 linux-wpt-2013").to_json()),
|
||||||
{'fail_fast': False,
|
{'fail_fast': False,
|
||||||
'matrix': [{
|
'matrix': [{
|
||||||
'bencher': False,
|
'bencher': False,
|
||||||
'name': 'Linux WPT',
|
'name': 'Linux (WPT)',
|
||||||
'profile': 'release',
|
'profile': 'release',
|
||||||
'unit_tests': False,
|
'unit_tests': False,
|
||||||
'workflow': 'linux',
|
'workflow': 'linux',
|
||||||
|
@ -266,30 +298,33 @@ class TestParser(unittest.TestCase):
|
||||||
}]
|
}]
|
||||||
})
|
})
|
||||||
|
|
||||||
a = JobConfig("Linux", Workflow.LINUX, unit_tests=True)
|
a = JobConfig("Linux (Unit Tests)", Workflow.LINUX, unit_tests=True)
|
||||||
b = JobConfig("Linux", Workflow.LINUX, unit_tests=False)
|
b = JobConfig("Linux", Workflow.LINUX, unit_tests=False)
|
||||||
self.assertTrue(a.merge(b), "Should merge jobs that have different unit test configurations.")
|
self.assertTrue(a.merge(b), "Should merge jobs that have different unit test configurations.")
|
||||||
self.assertEqual(a, JobConfig("Linux", Workflow.LINUX, unit_tests=True))
|
self.assertEqual(a, JobConfig("Linux (Unit Tests)", Workflow.LINUX, unit_tests=True))
|
||||||
|
|
||||||
a = handle_preset("linux")
|
a = handle_preset("linux-unit-tests")
|
||||||
b = handle_preset("linux-wpt")
|
a = handle_modifier(a, "linux-unit-tests")
|
||||||
|
b = handle_preset("linux-wpt-2020")
|
||||||
|
b = handle_modifier(b, "linux-wpt-2020")
|
||||||
self.assertTrue(a.merge(b), "Should merge jobs that have different unit test configurations.")
|
self.assertTrue(a.merge(b), "Should merge jobs that have different unit test configurations.")
|
||||||
self.assertEqual(a, JobConfig("Linux WPT", Workflow.LINUX, unit_tests=True, wpt_layout=Layout.layout2020))
|
self.assertEqual(a, JobConfig("Linux (Unit Tests, WPT)", Workflow.LINUX,
|
||||||
|
unit_tests=True, wpt_layout=Layout.layout2020))
|
||||||
|
|
||||||
a = JobConfig("Linux", Workflow.LINUX, unit_tests=True)
|
a = JobConfig("Linux (Unit Tests)", Workflow.LINUX, unit_tests=True)
|
||||||
b = JobConfig("Mac", Workflow.MACOS, unit_tests=True)
|
b = JobConfig("Mac", Workflow.MACOS, unit_tests=True)
|
||||||
self.assertFalse(a.merge(b), "Should not merge jobs with different workflows.")
|
self.assertFalse(a.merge(b), "Should not merge jobs with different workflows.")
|
||||||
self.assertEqual(a, JobConfig("Linux", Workflow.LINUX, unit_tests=True))
|
self.assertEqual(a, JobConfig("Linux (Unit Tests)", Workflow.LINUX, unit_tests=True))
|
||||||
|
|
||||||
a = JobConfig("Linux", Workflow.LINUX, unit_tests=True)
|
a = JobConfig("Linux (Unit Tests)", Workflow.LINUX, unit_tests=True)
|
||||||
b = JobConfig("Linux", Workflow.LINUX, unit_tests=True, profile="production")
|
b = JobConfig("Linux (Unit Tests, Production)", Workflow.LINUX, unit_tests=True, profile="production")
|
||||||
self.assertFalse(a.merge(b), "Should not merge jobs with different profiles.")
|
self.assertFalse(a.merge(b), "Should not merge jobs with different profiles.")
|
||||||
self.assertEqual(a, JobConfig("Linux", Workflow.LINUX, unit_tests=True))
|
self.assertEqual(a, JobConfig("Linux (Unit Tests)", Workflow.LINUX, unit_tests=True))
|
||||||
|
|
||||||
a = JobConfig("Linux", Workflow.LINUX, unit_tests=True)
|
a = JobConfig("Linux (Unit Tests)", Workflow.LINUX, unit_tests=True)
|
||||||
b = JobConfig("Linux", Workflow.LINUX, unit_tests=True, wpt_args="/css")
|
b = JobConfig("Linux (Unit Tests)", Workflow.LINUX, unit_tests=True, wpt_args="/css")
|
||||||
self.assertFalse(a.merge(b), "Should not merge jobs that run different WPT tests.")
|
self.assertFalse(a.merge(b), "Should not merge jobs that run different WPT tests.")
|
||||||
self.assertEqual(a, JobConfig("Linux", Workflow.LINUX, unit_tests=True))
|
self.assertEqual(a, JobConfig("Linux (Unit Tests)", Workflow.LINUX, unit_tests=True))
|
||||||
|
|
||||||
def test_full(self):
|
def test_full(self):
|
||||||
self.assertDictEqual(json.loads(Config("full").to_json()),
|
self.assertDictEqual(json.loads(Config("full").to_json()),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue