mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-03 00:39:45 +02:00
ci(v2): fail CI if build takes too much time (#4516)
* remove the .cache folder so that it removes both webpack cache-loader-v4/persistent-cache-v5 + webpack terser cache * Add GH action to track build time perf with a timeout * Add GH action to track build time perf with a timeout
This commit is contained in:
parent
88a48a072a
commit
f7614081dd
3 changed files with 37 additions and 2 deletions
2
.github/workflows/v2-build-blog-only.yml
vendored
2
.github/workflows/v2-build-blog-only.yml
vendored
|
@ -9,7 +9,7 @@ on:
|
|||
- 'packages/docusaurus/**'
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
build:
|
||||
timeout-minutes: 30
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
|
35
.github/workflows/v2-build-time-perf.yml
vendored
Normal file
35
.github/workflows/v2-build-time-perf.yml
vendored
Normal file
|
@ -0,0 +1,35 @@
|
|||
name: V2 Build Time Perf
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
paths-ignore:
|
||||
- 'website/docs/**'
|
||||
- 'website-1.x/**'
|
||||
- 'packages/docusaurus-1.x/**'
|
||||
- 'packages/docusaurus-init-1.x/**'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
timeout-minutes: 30
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
- name: Installation
|
||||
uses: bahmutov/npm-install@v1
|
||||
with:
|
||||
install-command: yarn
|
||||
|
||||
# Ensure build with a cold cache does not increase too much
|
||||
- name: Build (cold cache)
|
||||
run: yarn workspace docusaurus-2-website build
|
||||
timeout-minutes: 10
|
||||
|
||||
# Ensure build with a warm cache does not increase too much
|
||||
- name: Build (warm cache)
|
||||
run: yarn workspace docusaurus-2-website build
|
||||
timeout-minutes: 10
|
||||
|
||||
# TODO post a Github comment with build with perf warnings?
|
|
@ -25,6 +25,6 @@ export default async function clear(siteDir: string): Promise<unknown> {
|
|||
return Promise.all([
|
||||
removePath(path.join(siteDir, GENERATED_FILES_DIR_NAME)),
|
||||
removePath(path.join(siteDir, DEFAULT_BUILD_DIR_NAME)),
|
||||
removePath(path.join(siteDir, 'node_modules/.cache/cache-loader')),
|
||||
removePath(path.join(siteDir, 'node_modules', '.cache')),
|
||||
]);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue