Initial work towards benchmarking bundle size over time

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2024-11-26 17:21:24 +00:00
parent de820e11fc
commit 90342f1b82
No known key found for this signature in database
GPG key ID: A2B008A5F49F5D0D
7 changed files with 269 additions and 102 deletions

View file

@ -43,7 +43,7 @@ jobs:
working-directory: element-web
run: |
yarn install --frozen-lockfile
yarn ts-node ./scripts/gen-workflow-mermaid.ts ../element-desktop ../element-web ../matrix-js-sdk > docs/automations.md
tsx ./scripts/gen-workflow-mermaid.ts ../element-desktop ../element-web ../matrix-js-sdk > docs/automations.md
echo "- [Automations](automations.md)" >> docs/SUMMARY.md
- name: Setup mdBook

View file

@ -23,6 +23,7 @@ jobs:
statuses: write
deployments: write
actions: read
contents: write
steps:
- name: Download HTML report
uses: actions/download-artifact@v4
@ -44,3 +45,59 @@ jobs:
desc: Playwright Report
deployment_env: EndToEndTests
prefix: "e2e-"
benchmark:
if: github.event.workflow_run.conclusion != 'cancelled'
name: Benchmarks
runs-on: ubuntu-24.04
environment: Netlify
permissions:
statuses: write
deployments: write
actions: read
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
cache: "yarn"
node-version-file: package.json
- name: Install Deps
run: "yarn install --frozen-lockfile"
- name: Download webapp
uses: actions/download-artifact@v4
with:
name: webapp
path: webapp
- name: Generate benchmark result
run: ./scripts/benchmark-bundle.ts > benchmarks.json
- name: Evaluate benchmark result
uses: benchmark-action/github-action-benchmark@d48d326b4ca9ba73ca0cd0d59f108f9e02a381c7 # v1
with:
tool: "customSmallerIsBetter"
output-file-path: "benchmarks.json"
gh-pages-branch: benchmarks
auto-push: false
- name: Push latest develop results
if: github.event.workflow_run.head_branch == 'develop' && github.event.workflow_run.head_repository.owner.login == 'element-hq'
run: git push origin benchmarks
- name: 📤 Deploy to Netlify
uses: matrix-org/netlify-pr-preview@v3
if: github.event.workflow_run.head_branch == 'develop' && github.event.workflow_run.head_repository.owner.login == 'element-hq'
with:
path: .
owner: ${{ github.event.workflow_run.head_repository.owner.login }}
branch: ${{ github.event.workflow_run.head_branch }}
revision: ${{ github.event.workflow_run.head_sha }}
token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
site_id: ${{ vars.NETLIFY_SITE_ID }}
desc: Bundle Size Benchmark
deployment_env: BundleSize
prefix: "benchmark-"