Skip to content

add processConfiguration to export #88

add processConfiguration to export

add processConfiguration to export #88

# This workflow builds the packages on the base branch and the PR branch, and then records the sizes of the built packages.
# The size comparison is done in a separate workflow because this one can't leave PR comments.
name: Bundle size
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
build:
name: Build on the base branch and the PR branch
strategy:
matrix:
branch:
- base
- head
runs-on: ubuntu-latest
steps:
- name: Set checkout parameters
id: vars
run: |
if [[ "${{ matrix.branch }}" == "base" ]]; then
echo "ref=${{ github.base_ref }}" >> $GITHUB_OUTPUT
echo "repo=${{ github.repository }}" >> $GITHUB_OUTPUT
echo "branch_name=${{ github.base_ref }}" >> $GITHUB_OUTPUT
else
echo "ref=${{ github.event.pull_request.head.ref }}" >> $GITHUB_OUTPUT
echo "repo=${{ github.event.pull_request.head.repo.full_name }}" >> $GITHUB_OUTPUT
echo "branch_name=${{ github.event.pull_request.head.ref }}" >> $GITHUB_OUTPUT
fi
- name: Checkout ${{ matrix.branch }} branch
uses: actions/checkout@v4
with:
ref: ${{ steps.vars.outputs.ref }}
repository: ${{ steps.vars.outputs.repo }}
- name: Setup
uses: ./.github/actions/setup
- name: Build the packages
run: turbo run build
- name: Collect sizes in bytes
id: sizes
run: du -sb packages/*/dist > sizes-${{ steps.vars.outputs.branch_name }}.txt
- name: Upload the sizes
uses: actions/upload-artifact@v4
with:
name: sizes-${{ steps.vars.outputs.branch_name }}
path: sizes-${{ steps.vars.outputs.branch_name }}.txt