mirror of
https://github.com/facebook/docusaurus.git
synced 2025-04-29 02:08:36 +02:00
81 lines
3.3 KiB
YAML
81 lines
3.3 KiB
YAML
name: Build Performance
|
|
|
|
on:
|
|
# Note! you can't safely use "pull_request_target" here
|
|
# This workflow is mostly useful for "internal PRs"
|
|
# External PRs won't be able to post a PR comment
|
|
# See https://github.com/preactjs/compressed-size-action/issues/54
|
|
# See https://securitylab.github.com/research/github-actions-preventing-pwn-requests
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
- docusaurus-v**
|
|
paths:
|
|
- package.json
|
|
- yarn.lock
|
|
- packages/**
|
|
- website/**
|
|
- '!website/docs/**'
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
cancel-in-progress: true
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
build-size:
|
|
permissions:
|
|
checks: write # for preactjs/compressed-size-action to create and update the checks
|
|
contents: read # for actions/checkout to fetch code
|
|
issues: write # for preactjs/compressed-size-action to create comments
|
|
pull-requests: write # for preactjs/compressed-size-action to write a PR review
|
|
name: Build Size Report
|
|
timeout-minutes: 30
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
|
- name: Set up Node
|
|
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
|
|
with:
|
|
node-version: lts/*
|
|
cache: yarn
|
|
- name: Track build size changes
|
|
uses: preactjs/compressed-size-action@f780fd104362cfce9e118f9198df2ee37d12946c # v2
|
|
with:
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
build-script: build:website:fast
|
|
clean-script: clear:website # see https://github.com/facebook/docusaurus/pull/6838
|
|
pattern: '{website/build/assets/js/main*js,website/build/assets/css/styles*css,website/.docusaurus/globalData.json,website/.docusaurus/registry.js,website/.docusaurus/routes.js,website/.docusaurus/routesChunkNames.json,website/.docusaurus/site-metadata.json,website/.docusaurus/codeTranslations.json,website/.docusaurus/i18n.json,website/.docusaurus/docusaurus.config.mjs,website/build/index.html,website/build/docs.html,website/build/docs/**/*.html,website/build/blog.html,website/build/blog/**/*.html}'
|
|
# HTML files: exclude versioned docs pages, tags pages, html redirect files
|
|
exclude: '{website/build/docs/?.?.?/**/*.html,website/build/docs/next/**/*.html,website/build/blog/tags/**/*.html,**/*.html.html}'
|
|
strip-hash: '\.([^;]\w{7})\.'
|
|
minimum-change-threshold: 30
|
|
compression: none
|
|
build-time:
|
|
name: Build Time Perf
|
|
timeout-minutes: 30
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
|
- name: Set up Node
|
|
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
|
|
with:
|
|
node-version: lts/*
|
|
cache: yarn
|
|
- name: Installation
|
|
run: yarn
|
|
|
|
# Ensure build with a cold cache does not increase too much
|
|
- name: Build (cold cache)
|
|
run: yarn build:website:fast
|
|
timeout-minutes: 8
|
|
|
|
# Ensure build with a warm cache does not increase too much
|
|
- name: Build (warm cache)
|
|
run: yarn build:website:fast
|
|
timeout-minutes: 2
|
|
# TODO post a GitHub comment with build with perf warnings?
|