chore(deps-dev): bump vite from 5.4.11 to 6.0.1 #649
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: '📦 Package size' | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened] | |
permissions: | |
pull-requests: write | |
jobs: | |
calculate-base: | |
runs-on: ubuntu-latest | |
outputs: | |
package_size: ${{ steps.package-base.outputs.package_size }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.base_ref }} | |
- name: Get commit short hash | |
id: commit | |
run: | | |
short=$(git rev-parse --short HEAD) | |
echo "short=$short" >> "$GITHUB_OUTPUT" | |
- name: Setup Node ⚙️ | |
uses: ./.github/actions/setup-node | |
- name: 📦 Cache package size for commit ${{ steps.commit.outputs.short }} | |
uses: actions/cache@v4 | |
with: | |
path: base-package-size.txt | |
key: base-package-size-os-${{ runner.os }}-commit-${{ steps.commit.outputs.short }} | |
- name: 🎁 Calculate package size in ${{ github.base_ref }} | |
id: package-base | |
run: | | |
if [ -f base-package-size.txt ]; then | |
echo "Getting package size from cache" | |
package_size=$(<base-package-size.txt) | |
else | |
echo "Package size not available in the cache" | |
package_size=$(pnpm publish --dry-run --no-git-checks 2>&1 | grep "unpacked size" | awk '{print $5 $6}') | |
fi | |
echo "$package_size" > base-package-size.txt | |
echo "package_size=$package_size" >> "$GITHUB_OUTPUT" | |
echo "Package size: $package_size" | |
calculate-head: | |
runs-on: ubuntu-latest | |
outputs: | |
package_size: ${{ steps.package-head.outputs.package_size }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.head_ref }} | |
- name: Setup Node ⚙️ | |
uses: ./.github/actions/setup-node | |
- name: 🎁 Calculate package size in ${{ github.head_ref }} | |
id: package-head | |
run: | | |
package_size=$(pnpm publish --dry-run --no-git-checks 2>&1 | grep "unpacked size" | awk '{print $5 $6}') | |
echo "package_size=$package_size" >> "$GITHUB_OUTPUT" | |
echo "Package size: $package_size" | |
write-comment: | |
runs-on: ubuntu-latest | |
needs: [calculate-base, calculate-head] | |
steps: | |
- uses: marocchino/sticky-pull-request-comment@v2 | |
env: | |
BASE_PACKAGE_SIZE: ${{needs.calculate-base.outputs.package_size}} | |
HEAD_PACKAGE_SIZE: ${{needs.calculate-head.outputs.package_size}} | |
with: | |
header: <package-size> | |
message: | | |
## 📦 Package Metrics 📦 | |
* Size of the Package in the base (${{ github.base_ref }}): **${{ env.BASE_PACKAGE_SIZE }}** | |
* Size of the Package in this branch (${{ github.head_ref }}): **${{ env.HEAD_PACKAGE_SIZE }}** |