mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
90a5d48a2f
- update paths - update working directory - rename files for clarity when merged into the main react repo
59 lines
1.8 KiB
YAML
59 lines
1.8 KiB
YAML
# Runs the parser benchmark on every push to main, and compares it with the previous run
|
|
name: Compiler Benchmark (Rust)
|
|
|
|
on:
|
|
push:
|
|
branches: ["main"]
|
|
paths:
|
|
- .github/workflows/**
|
|
- compiler/crates/**
|
|
- compiler/Cargo.*
|
|
- compiler/*.toml
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
RUSTFLAGS: -Dwarnings
|
|
|
|
defaults:
|
|
run:
|
|
working-directory: compiler
|
|
|
|
jobs:
|
|
bench:
|
|
name: Parser Benchmark
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: Swatinem/rust-cache@v2
|
|
- run: yarn install --frozen-lockfile
|
|
working-directory: crates/forget_napi
|
|
- run: mkdir dist -p
|
|
working-directory: crates/forget_napi
|
|
- run: yarn build
|
|
working-directory: crates/forget_napi
|
|
- run: yarn install --frozen-lockfile
|
|
working-directory: bench/parser-benchmark
|
|
- name: Run benchmark
|
|
run: node index.js --ci --sampleSize=3 | tee results.json
|
|
working-directory: bench/parser-benchmark
|
|
# Download previous benchmark result from cache (if exists)
|
|
- name: Download previous benchmark data
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ./cache
|
|
key: ${{ runner.os }}-benchmark
|
|
- name: Store benchmark result
|
|
uses: benchmark-action/github-action-benchmark@v1
|
|
with:
|
|
name: "${{ runner.os }} Benchmark"
|
|
tool: customBiggerIsBetter
|
|
output-file-path: bench/parser-benchmark/results.json
|
|
# Where the previous data file is stored
|
|
external-data-json-path: ./cache/parser-benchmark-results.json
|
|
# Workflow will fail when an alert happens
|
|
fail-on-alert: true
|
|
# Enable Job Summary for PRs
|
|
summary-always: true
|
|
# GitHub API token to make a commit comment
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|