mirror of
https://github.com/stablyai/orca.git
synced 2026-11-16 02:47:34 +00:00
Editing it triggers the benchmark, whose parity check currently fails on arm64 because max-quality brotli output for the mobile page differs by architecture. The benchmark only needs some diagnostics URL, and the old host still serves it.
138 lines
5.0 KiB
YAML
138 lines
5.0 KiB
YAML
name: Release JavaScript comparison
|
|
|
|
on:
|
|
pull_request:
|
|
types: [opened, synchronize, reopened, ready_for_review, converted_to_draft]
|
|
paths: ['.github/workflows/release-javascript-benchmark.yml']
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: release-javascript-comparison-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
ORCA_BACKGROUND_LAUNCH: '1'
|
|
ORCA_DIAGNOSTICS_TOKEN_URL: https://www.onorca.dev/diagnostics/token
|
|
ORCA_POSTHOG_WRITE_KEY: ci-build-comparison
|
|
NODE_OPTIONS: --max-old-space-size=4096
|
|
|
|
jobs:
|
|
bundle:
|
|
if: github.event_name != 'pull_request' || github.event.pull_request.draft != true
|
|
uses: ./.github/workflows/release-javascript.yml
|
|
with:
|
|
ref: ${{ github.sha }}
|
|
secrets:
|
|
ORCA_POSTHOG_WRITE_KEY: ci-build-comparison
|
|
|
|
measure:
|
|
needs: bundle
|
|
name: ${{ matrix.mode }} ${{ matrix.host.platform }} ${{ matrix.host.arch }}
|
|
runs-on: ${{ matrix.host.os }}
|
|
timeout-minutes: 30
|
|
strategy:
|
|
fail-fast: false
|
|
max-parallel: 8
|
|
matrix:
|
|
mode: [baseline, shared]
|
|
host:
|
|
- os: ubuntu-latest
|
|
platform: linux
|
|
arch: x64
|
|
- os: ubuntu-24.04-arm
|
|
platform: linux
|
|
arch: arm64
|
|
- os: windows-2022
|
|
platform: win32
|
|
arch: x64
|
|
- os: macos-15
|
|
platform: darwin
|
|
arch: arm64
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
ref: ${{ needs.bundle.outputs.source_sha }}
|
|
persist-credentials: false
|
|
- uses: ./.github/actions/install-node-dependencies
|
|
with:
|
|
native-runtime: node
|
|
persist-native-cache: 'false'
|
|
- uses: ./.github/actions/install-mobile-dependencies
|
|
- name: Install Linux provider dependencies
|
|
if: runner.os == 'Linux'
|
|
run: sudo apt-get update && sudo apt-get install -y python3-gi gir1.2-atspi-2.0 at-spi2-core xclip xdotool
|
|
- name: Resolve build identity
|
|
shell: bash
|
|
run: |
|
|
RELEASE_TAG="v$(node -p 'require("./package.json").version')"
|
|
export RELEASE_TAG
|
|
RELEASE_JAVASCRIPT_ARTIFACT='config/scripts/release/javascript-artifacts/release-javascript-artifact.mjs'
|
|
if [ ! -f "$RELEASE_JAVASCRIPT_ARTIFACT" ]; then
|
|
RELEASE_JAVASCRIPT_ARTIFACT='config/scripts/release-javascript-artifact.mjs'
|
|
fi
|
|
echo "ORCA_BUILD_IDENTITY=$(node "$RELEASE_JAVASCRIPT_ARTIFACT" identity)" >> "$GITHUB_ENV"
|
|
- name: Download shared JavaScript
|
|
if: matrix.mode == 'shared'
|
|
uses: actions/download-artifact@v8
|
|
with:
|
|
name: release-javascript
|
|
path: .build/release-javascript
|
|
- name: Measure release build
|
|
shell: bash
|
|
env:
|
|
MEASUREMENT_MODE: ${{ matrix.mode }}
|
|
ORCA_RELEASE_JAVASCRIPT_SOURCE_SHA: ${{ needs.bundle.outputs.source_sha }}
|
|
run: |
|
|
RELEASE_JAVASCRIPT_BENCHMARK='config/scripts/release/javascript-artifacts/release-javascript-benchmark.mjs'
|
|
if [ ! -f "$RELEASE_JAVASCRIPT_BENCHMARK" ]; then
|
|
RELEASE_JAVASCRIPT_BENCHMARK='config/scripts/release-javascript-benchmark.mjs'
|
|
fi
|
|
node "$RELEASE_JAVASCRIPT_BENCHMARK" "$MEASUREMENT_MODE"
|
|
- uses: actions/upload-artifact@v7
|
|
with:
|
|
name: release-javascript-measurement-${{ matrix.mode }}-${{ matrix.host.platform }}-${{ matrix.host.arch }}
|
|
path: .build/release-javascript-measurements/
|
|
retention-days: 7
|
|
|
|
comparison:
|
|
needs: [bundle, measure]
|
|
runs-on: ubuntu-slim
|
|
timeout-minutes: 180
|
|
permissions:
|
|
contents: read
|
|
actions: read
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
ref: ${{ needs.bundle.outputs.source_sha }}
|
|
persist-credentials: false
|
|
- uses: actions/setup-node@v6
|
|
with:
|
|
node-version-file: package.json
|
|
check-latest: true
|
|
- uses: ./.github/actions/install-node-dependencies
|
|
- uses: actions/download-artifact@v8
|
|
with:
|
|
pattern: release-javascript-measurement-*
|
|
path: .build/release-javascript-measurements
|
|
- name: Compare build and transfer timings
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
run: |
|
|
gh api "repos/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID/jobs?per_page=100" > .build/release-javascript-measurements/jobs.json
|
|
RELEASE_JAVASCRIPT_BENCHMARK='config/scripts/release/javascript-artifacts/release-javascript-benchmark.mjs'
|
|
if [ ! -f "$RELEASE_JAVASCRIPT_BENCHMARK" ]; then
|
|
RELEASE_JAVASCRIPT_BENCHMARK='config/scripts/release-javascript-benchmark.mjs'
|
|
fi
|
|
node "$RELEASE_JAVASCRIPT_BENCHMARK" summary
|
|
cat .build/release-javascript-measurements/comparison.md >> "$GITHUB_STEP_SUMMARY"
|
|
- uses: actions/upload-artifact@v7
|
|
if: always()
|
|
with:
|
|
name: release-javascript-comparison
|
|
path: .build/release-javascript-measurements/comparison.md
|
|
retention-days: 30
|