Skip to content

Commit

Permalink
test: Добавлен плагин
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeniysemin committed Sep 11, 2023
1 parent 4023f3e commit 0b8e1d2
Show file tree
Hide file tree
Showing 5 changed files with 629 additions and 27 deletions.
83 changes: 65 additions & 18 deletions .github/workflows/bundle-size.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,39 @@
name: Bundle_Size
# name: Bundle_Size

# on:
# push:
# branches:
# - '*'
# - '!master'

# jobs:
# bundle-size:
# name: Bundle_Size
# runs-on: ubuntu-latest
# steps:
# - name: Use Node.js 18.x
# uses: actions/setup-node@v1
# with:
# node-version: 18.x

# - name: Checkout current
# uses: actions/checkout@v3

# - name: Clone master
# uses: actions/checkout@v3
# with:
# ref: 'master' # branch to compare to
# path: br-base # required
# token: ${{ secrets.GITHUB_TOKEN }}

# - name: Bundle size report
# id: bundleSize
# uses: nejcm/[email protected]
# with:
# paths: '/esm/*.js'
# onlyDiff: 'true'

name: 'Bundle size reporter'

on:
push:
Expand All @@ -7,28 +42,40 @@ on:
- '!master'

jobs:
bundle-size:
name: Bundle_Size
composite:
name: 'composite'
runs-on: ubuntu-latest
steps:
- name: Use Node.js 18.x
uses: actions/setup-node@v1
with:
node-version: 18.x

- name: Checkout current
uses: actions/checkout@v3

- name: Clone master
# Checkout branch to compare to [required]
- name: Checkout base branch
uses: actions/checkout@v3
with:
ref: 'master' # branch to compare to
path: br-base # required
ref: 'master'
path: br-base
token: ${{ secrets.GITHUB_TOKEN }}

- name: Bundle size report
# Generate the bundle size difference report [required]
- name: Generate report
id: bundleSize
uses: nejcm/[email protected]
uses: nejcm/[email protected]
with:
paths: '.size-snapshot.json'
onlyDiff: 'false'

# Post github action summary
- name: Post summary
if: ${{ steps.bundleSize.outputs.hasDifferences == 'true' }} # post only in case of changes
run: |
echo '${{ steps.bundleSize.outputs.summary }}' >> $GITHUB_STEP_SUMMARY
shell: bash

# Post github action comment
- name: Post comment
uses: marocchino/sticky-pull-request-comment@v2
if: ${{ steps.bundleSize.outputs.hasDifferences == 'true' }} # post only in case of changes
with:
paths: '/esm/*.js'
onlyDiff: 'true'
number: ${{ github.event.pull_request.number }}
header: 'Bundle size report'
append: 'false'
message: '${{ steps.bundleSize.outputs.summary }}'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27 changes: 27 additions & 0 deletions .size-snapshot.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"index.js": {
"bundled": 68391,
"minified": 18748,
"gzipped": 6091
},
"assistant-!~{001}~.js": {
"bundled": 414989,
"minified": 110354,
"gzipped": 27055
},
"createAssistantDevOrigin.js": {
"bundled": 119683,
"minified": 101454,
"gzipped": 64063
},
"assistant.development.min.js": {
"bundled": 210132,
"minified": 210047,
"gzipped": 90494
},
"assistant.production.min.js": {
"bundled": 12127,
"minified": 12107,
"gzipped": 4351
}
}
Loading

0 comments on commit 0b8e1d2

Please sign in to comment.