Skip to content
This repository has been archived by the owner on Dec 11, 2023. It is now read-only.

[fix] Event UpdateDirty didn't fire when remounting #28

[fix] Event UpdateDirty didn't fire when remounting

[fix] Event UpdateDirty didn't fire when remounting #28

name: core-bundle-size
on: [pull_request]
jobs:
build_head:
runs-on: [ubuntu-latest]
permissions:
contents: read
outputs:
result: ${{ steps.export.outputs.HEAD_RESULT }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Restore pr yarn cache
uses: actions/cache@v3
id: restore-yarn-cache
with:
path: ~/.yarn/cache
key: ${{ runner.os }}-yarn-pr-${{ github.event.number }}
- name: Restore shared yarn cache
if: steps.restore-yarn-cache.outputs.cache-hit != 'true'
uses: actions/cache/restore@v3
with:
path: .yarn/cache
key: ${{ runner.os }}-yarn-shared
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install Dependencies
run: yarn install --immutable
- name: Build
run: yarn workspace @sugarform/core build
- name: Export Size Info
id: export
run: |
echo "HEAD_RESULT=$(yarn workspace @sugarform/tools bundle-size inspect core)" >> $GITHUB_OUTPUT
build_base:
runs-on: [ubuntu-latest]
permissions:
contents: read
outputs:
result: ${{ steps.export.outputs.BASE_RESULT }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.base_ref }}
- name: Restore shared yarn cache
if: steps.restore-yarn-cache.outputs.cache-hit != 'true'
uses: actions/cache/restore@v3
with:
path: .yarn/cache
key: ${{ runner.os }}-yarn-shared
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install Dependencies
run: yarn install --immutable
- name: Build
run: yarn workspace @sugarform/core build
- name: Export Size Info
id: export
run: |
echo "BASE_RESULT=$(yarn workspace @sugarform/tools bundle-size inspect core)" >> $GITHUB_OUTPUT
compare:
runs-on: [ubuntu-latest]
needs: [build_base, build_head]
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.base_ref }}
- name: Restore pr yarn cache
uses: actions/cache@v3
id: restore-yarn-cache
with:
path: .yarn/cache
key: ${{ runner.os }}-yarn-pr-${{ github.event.number }}
- name: Restore shared yarn cache
if: steps.restore-yarn-cache.outputs.cache-hit != 'true'
uses: actions/cache/restore@v3
with:
path: ~/.yarn/cache
key: ${{ runner.os }}-yarn-shared
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install Dependencies
run: yarn install --immutable
- name: Calculation
id: calc
uses: gh640/command-result-action@v1
env:
HEAD_RESULT: ${{ needs.build_head.outputs.result }}
BASE_RESULT: ${{ needs.build_base.outputs.result }}
with:
command: yarn workspace @sugarform/tools bundle-size diff
- name: Post Review Comment
uses: thollander/actions-comment-pull-request@v2
with:
message: ${{ steps.calc.outputs.stdout }}
comment_tag: 'bundle-size-diff'