P0080 | Saurabh-Divyanshu | angular upgrade 14-21 and refactor code and syntax and Design #637
This file contains hidden or 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
| # This is a basic workflow to help you get started with Actions | |
| name: Build check | |
| # Controls when the action will run. | |
| on: | |
| pull_request: | |
| branches: | |
| - development | |
| - main | |
| - production | |
| workflow_dispatch: | |
| inputs: | |
| logLevel: | |
| description: "Log level" | |
| required: true | |
| default: "warning" | |
| tags: | |
| description: "Test scenario tags" | |
| # Triggers the workflow on push or pull request events but only for the master branch | |
| # Allows you to run this workflow manually from the Actions tab | |
| # workflow_dispatch: | |
| # A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
| jobs: | |
| # This workflow contains a single job called "build" | |
| build: | |
| # The type of runner that the job will run on | |
| runs-on: ubuntu-latest | |
| # Steps represent a sequence of tasks that will be executed as part of the job | |
| steps: | |
| # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
| - name: Check out Git repository | |
| uses: actions/checkout@v3 | |
| with: | |
| ref: ${{ github.event.pull_request.head.ref }} | |
| fetch-depth: 0 | |
| - name: Fetch branches | |
| run: git fetch --no-tags --prune --depth=5 | |
| # Runs a single command using the runners shell | |
| - name: Install Node.js & NPM | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: "20" | |
| # Runs npm i | |
| - uses: bahmutov/npm-install@v1 | |
| env: | |
| CYPRESS_INSTALL_BINARY: 0 | |
| with: | |
| useRollingCache: true | |
| working-directory: . | |
| install-command: npm ci --audit false | |
| - name: Starting build check | |
| shell: bash | |
| run: echo "branch_name=${GITHUB_REF##*/}" >> $GITHUB_ENV | |
| id: extract_branch | |
| - if: ${{github.event.pull_request.base.ref == 'main'}} | |
| run: npx nx affected --target=build --base='origin/main' --configuration=local | |
| - if: ${{github.event.pull_request.base.ref == 'production'}} | |
| run: npx nx affected --target=build --base='origin/production' --configuration=local | |
| - if: ${{github.event.pull_request.base.ref == 'development'}} | |
| run: npx nx affected --target=build --base='origin/development' --configuration=local | |
| - name: Check widget bundle size | |
| if: always() | |
| run: | | |
| WIDGET_FILE="apps/36-blocks/src/assets/proxy-auth/proxy-auth.js" | |
| if [ -f "$WIDGET_FILE" ]; then | |
| SIZE=$(stat -c%s "$WIDGET_FILE") | |
| echo "proxy-auth.js size: $((SIZE / 1024)) KB" | |
| if [ $SIZE -gt 3145728 ]; then | |
| echo "::error::proxy-auth.js exceeds 3 MB ($((SIZE / 1024)) KB) — check for bundle bloat!" | |
| exit 1 | |
| fi | |
| fi |