-
Notifications
You must be signed in to change notification settings - Fork 8
94 lines (88 loc) · 2.87 KB
/
ci-perf.yml
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
---
name: "📊 Build Performance"
# 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
on:
pull_request:
branches: [main, next]
paths:
- "crowdin.yml"
- "sidebars.js"
- "package.json"
- "pnpm-lock.yaml"
- "babel.config.js"
- "docusaurus.config.ts"
- "src/**"
- "static/**"
- "!docs/**"
- "!blog/**"
- "!i18n/**"
- "!community/**"
- "!ecosystem/**"
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: read
env:
URL: "https://wiki.zshell.dev"
jobs:
build-size:
name: " 📊 Build Size Report"
timeout-minutes: 30
runs-on: ubuntu-latest
permissions:
checks: write # for preactjs/compressed-size-action to create and update the checks
contents: read # for actions/checkout to fetch code
pull-requests: write # for preactjs/compressed-size-action to write a PR review
issues: write # for preactjs/compressed-size-action to create comments
steps:
- name: "⤵️ Check out code from GitHub"
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: "📦 Setup pnpm"
uses: pnpm/[email protected]
- name: "⎔ Setup node"
uses: actions/[email protected]
with:
node-version: current
cache: "pnpm"
- run: pnpm i --prod
- uses: preactjs/compressed-size-action@v2
with:
build-script: "build:en"
pattern: "{build/assets/js/*.js,build/assets/css/*.css,build/**/*.html,.docusaurus/globalData.json,build/blog/**/swiss-army-knife-for-zsh/*}"
exclude: "{./build/manifest.json,./build/**/*.xml,**/*.map,**/node_modules/**,build/assets/**/*.ttf}"
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: "⤵️ Check out code from GitHub"
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: "📦 Setup pnpm"
uses: pnpm/[email protected]
- name: "⎔ Setup node"
uses: actions/[email protected]
with:
node-version: current
cache: "pnpm"
- run: pnpm i --prod
# Ensure build with a cold cache does not increase too much
- name: "Build (cold cache)"
run: pnpm build:en
timeout-minutes: 8
# Ensure build with a warm cache does not increase too much
- name: "Build (warm cache)"
run: pnpm build:en
timeout-minutes: 2