Files
browser/.github/actions/orderfile/action.yml
T

80 lines
2.8 KiB
YAML

name: "Orderfile"
description: "Regenerate orderfile/lightpanda.ld and orderfile/v8.txt from a profile of the CDP bench"
# Runs orderfile/tools/regen.sh, which writes the two files back into the
# checkout. What the caller does with them (commit, or just build) is its own
# business. See orderfile/README.md.
#
# Needs a Linux runner with sudo (the script flips
# /sys/kernel/debug/fault_around_bytes), plus node, go, python3 and binutils.
# Call it after ./.github/actions/install and after the v8 snapshot.
inputs:
build-args:
description: 'zig build args for the profiling build: the release build args minus -Dorderfile'
required: true
runs:
description: 'CDP bench iterations'
required: false
default: '100'
demo-repository:
description: 'Checkout holding the CDP bench (demo/puppeteer/cdp.js)'
required: false
default: 'lightpanda-io/demo'
outputs:
out-dir:
description: 'Scratch directory with the profile: resident.json, hot.text, hot.rodata, gen_order.stats, result.txt and the generated lightpanda.ld / v8.txt'
value: ${{ steps.out.outputs.dir }}
runs:
using: "composite"
steps:
# The bench the profile is taken from.
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
repository: ${{ inputs.demo-repository }}
path: demo
- run: npm install
shell: bash
working-directory: demo
# Its own step, so the path is still an output when the profile fails.
- name: profile scratch directory
id: out
shell: bash
run: echo "dir=$RUNNER_TEMP/orderfile-regen" >> "$GITHUB_OUTPUT"
- name: regenerate the profile
shell: bash
env:
DEMO_DIR: demo
RUNS: ${{ inputs.runs }}
OUT: ${{ steps.out.outputs.dir }}
BUILD_ARGS: ${{ inputs.build-args }}
run: |
# BUILD_ARGS is a list of flags, it has to word-split.
# shellcheck disable=SC2086
orderfile/tools/regen.sh $BUILD_ARGS
# $OUT dies with the runner, and a failed profile is the one case where
# the page dump and the bench output are worth reading afterwards.
- name: upload profile
if: failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: orderfile-profile
path: |
${{ steps.out.outputs.dir }}/result.txt
${{ steps.out.outputs.dir }}/gen_order.stats
${{ steps.out.outputs.dir }}/hot.text
${{ steps.out.outputs.dir }}/hot.rodata
${{ steps.out.outputs.dir }}/resident.json
${{ steps.out.outputs.dir }}/link.line
${{ steps.out.outputs.dir }}/bench.out
${{ steps.out.outputs.dir }}/lightpanda.ld
${{ steps.out.outputs.dir }}/v8.txt
retention-days: 10