Skip to content

Commit

Permalink
ci(): Add bundle size report (fabricjs#8395)
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaMan123 authored and frankrousseau committed Jan 6, 2023
1 parent 39a34b2 commit d1d09e2
Show file tree
Hide file tree
Showing 10 changed files with 8,822 additions and 195 deletions.
54 changes: 53 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,65 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Uglified build
uses: actions/setup-node@v1
with:
node-version: 16.x
- run: npm ci
- run: npm run build
stats:
name: Build stats
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 16.x
- run: npm ci
- name: build stats
run: npm run build -- -s
- name: persist
id: b
uses: actions/github-script@v6
with:
result-encoding: string
script: |
const fs = require('fs');
return JSON.stringify({
size: JSON.parse(fs.readFileSync('cli_output/build_size.json')),
stats: JSON.parse(fs.readFileSync('cli_output/build_stats.json')),
});
- name: checkout src files
run: git checkout origin/master -- src
- name: upstream build stats
run: npm run build -- -s
- name: persist
id: a
uses: actions/github-script@v6
with:
result-encoding: string
script: |
const fs = require('fs');
return JSON.stringify({
size: JSON.parse(fs.readFileSync('cli_output/build_size.json')),
stats: JSON.parse(fs.readFileSync('cli_output/build_stats.json')),
});
- name: process
uses: actions/github-script@v6
with:
result-encoding: string
script: |
const { run } = await import('${{ github.workspace }}/scripts/buildStats.mjs');
const res = await run({
github,
context,
core,
a: JSON.parse('${{ steps.a.outputs.result }}'),
b: JSON.parse('${{ steps.b.outputs.result }}'),
});
lint:
runs-on: ubuntu-latest
steps:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## [next]

- ci(): build stats report [#8395](https://github.com/fabricjs/fabric.js/pull/8395)
- chore(TS): convert object to es6 class [#8322](https://github.com/fabricjs/fabric.js/pull/8322)
- docs(): guides follow up, feature request template [#8379](https://github.com/fabricjs/fabric.js/pull/8379)
- docs(): refactor guides, bug report template [#8189](https://github.com/fabricjs/fabric.js/pull/8189)
Expand Down
Loading

0 comments on commit d1d09e2

Please sign in to comment.