feat: add support for data-analytics- [FC-3152] #1767
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: Blade Bundle Size | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened] | |
push: | |
branches: | |
- master | |
env: | |
GITHUB_ACCESS_TOKEN: ${{ secrets.CI_BOT_TOKEN }} | |
jobs: | |
pr-bundle-size: | |
name: Generate PR Report | |
runs-on: ubuntu-latest # nosemgrep: non-self-hosted-runner | |
if: ${{ github.event_name == 'pull_request' && github.event.head_commit.author.name != 'rzpcibot' }} | |
steps: | |
- name: Checkout Codebase | |
uses: actions/checkout@v4 | |
- name: Use Node v18 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18.12.1 | |
- name: Setup Cache & Install Dependencies | |
uses: ./.github/actions/install-dependencies | |
- name: Update Bundle Size Data | |
run: yarn generate-bundle-size-info | |
working-directory: packages/blade | |
- name: Danger | |
run: yarn danger ci | |
working-directory: packages/blade | |
env: | |
DANGER_GITHUB_API_TOKEN: ${{ env.GITHUB_ACCESS_TOKEN }} | |
DANGER_DISABLE_TRANSPILATION: 'true' | |
master-bundle-size: | |
name: Update Base Stats | |
runs-on: ubuntu-latest # nosemgrep: non-self-hosted-runner | |
if: ${{ github.event_name == 'push' }} | |
steps: | |
- name: Checkout Codebase | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.CI_BOT_TOKEN }} | |
ref: master | |
- name: Use Node v18 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18.12.1 | |
- name: Setup Cache & Install Dependencies | |
uses: ./.github/actions/install-dependencies | |
- name: Build Blade React Production | |
run: yarn run-s build:clean build:generate-types build:react-prod | |
working-directory: packages/blade | |
- name: Update Bundle Size Data | |
run: yarn generate-bundle-size-info | |
working-directory: packages/blade | |
env: | |
BUNDLE_SIZE_STATS_FILENAME: 'baseBundleSizeStats.json' | |
- name: Check if file is modified | |
id: file-check | |
run: if [ -n "$(git status baseBundleSizeStats.json --porcelain)" ]; then echo "result=true" >> $GITHUB_OUTPUT; else echo "result=false" >> $GITHUB_OUTPUT; fi | |
working-directory: packages/blade | |
- name: Commit Updated Bundle Size Data | |
if: ${{ steps.file-check.outputs.result == 'true' }} | |
run: | | |
git config user.email "[email protected]" | |
git config user.name "rzpcibot" | |
git add baseBundleSizeStats.json | |
git commit -m "chore: update bundle size data [skip ci]" | |
git push origin master:bundle-size-stats --force | |
working-directory: packages/blade |