-
Notifications
You must be signed in to change notification settings - Fork 306
70 lines (63 loc) · 2.43 KB
/
build-perf.yml
File metadata and controls
70 lines (63 loc) · 2.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Build Performance
on:
pull_request:
branches:
- main
paths-ignore:
- demo/docs/**
permissions: {}
concurrency:
group: build-perf-${{ github.event.number }}
cancel-in-progress: true
jobs:
build-size:
if: ${{ github.repository == 'PaloAltoNetworks/docusaurus-openapi-docs' }}
name: Build Size Report
timeout-minutes: 30
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: "22"
cache: yarn
- uses: preactjs/compressed-size-action@66325aad6443cb7cf89c4bfcd414aea2367cda94 # v2.9.1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
build-script: build
clean-script: clean
pattern: "{demo/build/assets/js/main*js,demo/build/assets/js/runtime~main*js,demo/build/assets/css/styles*css,demo/.docusaurus/globalData.json,demo/.docusaurus/registry.js,demo/.docusaurus/routes.js,demo/.docusaurus/routesChunkNames.json,demo/.docusaurus/site-metadata.json,demo/.docusaurus/codeTranslations.json,demo/.docusaurus/i18n.json,demo/.docusaurus/docusaurus.config.mjs,demo/build/index.html,demo/build/petstore/**/*.html}"
strip-hash: '\.([^;]\w{7})\.'
minimum-change-threshold: 30
compression: none
build-time:
if: ${{ github.repository == 'PaloAltoNetworks/docusaurus-openapi-docs' }}
name: Build Time Perf
timeout-minutes: 30
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: "22"
cache: yarn
- name: Installation
run: yarn --frozen-lockfile --prefer-offline --ignore-scripts
# Ensure build with a cold cache does not increase too much
- name: Build (cold cache)
run: yarn build
timeout-minutes: 8
# Ensure build with a warm cache does not increase too much
- name: Build (warm cache)
run: yarn build
timeout-minutes: 2
# TODO post a Github comment with build with perf warnings?