@samitouri / QOS-React / commits / 569c3b28ee

[ci] Combine sizebot jobs (#32333)

There's no real reason to have 2 jobs for sizebot. It's more of a historical artifact from before the GH migration. Merging them should require one less worker needing to be provisioned and some of the extra overhead --- [//]: # (BEGIN SAPLING FOOTER) Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/react/pull/32333). * __->__ #32333 * #32332

lauren committed Feb 7, 2025 at 16:39 UTC 569c3b28ee968df58ff3c55be9a8efa2ee72fc82
1 file changed +7 -40
.github/workflows/runtime_build_and_test.yml
+7 -40
@@ -585,9 +585,10 @@ jobs:
585 RELEASE_CHANNEL: experimental
586
587 # ----- SIZEBOT -----
588 - download_base_build_for_sizebot:
589 - if: ${{ github.event_name == 'pull_request' && github.ref_name != 'main' }}
590 - name: Download base build for sizebot
588 + sizebot:
589 + if: ${{ github.event_name == 'pull_request' && github.ref_name != 'main' && github.event.pull_request.base.ref == 'main' }}
590 + name: Run sizebot
591 + needs: [build_and_lint]
592 runs-on: ubuntu-latest
593 steps:
594 - uses: actions/checkout@v4
@@ -603,16 +604,14 @@ jobs:
604 id: node_modules
605 with:
606 path: "**/node_modules"
606 - key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('yarn.lock', 'scripts/release/yarn.lock') }}
607 + key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
608 - name: Ensure clean build directory
609 run: rm -rf build
609 - - run: yarn install --frozen-lockfile
610 - run: yarn install --frozen-lockfile
611 working-directory: scripts/release
612 - name: Download artifacts for base revision
613 run: |
614 - git fetch origin main
615 - GH_TOKEN=${{ github.token }} scripts/release/download-experimental-build.js --commit=$(git rev-parse origin/main)
614 + GH_TOKEN=${{ github.token }} scripts/release/download-experimental-build.js --commit=$(git rev-parse ${{ github.event.pull_request.base.sha }})
615 mv ./build ./base-build
616 # TODO: The `download-experimental-build` script copies the npm
617 # packages into the `node_modules` directory. This is a historical
@@ -620,33 +619,8 @@ jobs:
619 # don't exist.
620 - name: Delete extraneous files
621 run: rm -rf ./base-build/node_modules
623 - - name: Display structure of base-build
622 + - name: Display structure of base-build from origin/main
623 run: ls -R base-build
625 - - name: Archive base-build
626 - uses: actions/upload-artifact@v4
627 - with:
628 - name: base-build
629 - path: base-build
630 -
631 - sizebot:
632 - name: Run sizebot
633 - needs: [build_and_lint, download_base_build_for_sizebot]
634 - runs-on: ubuntu-latest
635 - steps:
636 - - uses: actions/checkout@v4
637 - with:
638 - ref: ${{ github.event.pull_request.head.sha || github.sha }}
639 - - uses: actions/setup-node@v4
640 - with:
641 - node-version-file: '.nvmrc'
642 - cache: yarn
643 - cache-dependency-path: yarn.lock
644 - - name: Restore cached node_modules
645 - uses: actions/cache@v4
646 - id: node_modules
647 - with:
648 - path: "**/node_modules"
649 - key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
624 - name: Ensure clean build directory
625 run: rm -rf build
626 - run: yarn install --frozen-lockfile
@@ -662,13 +636,6 @@ jobs:
636 node ./scripts/print-warnings/print-warnings.js > build/__test_utils__/ReactAllWarnings.js
637 - name: Display structure of build for PR
638 run: ls -R build
665 - - name: Restore archived base-build from origin/main
666 - uses: actions/download-artifact@v4
667 - with:
668 - name: base-build
669 - path: base-build
670 - - name: Display structure of base-build from origin/main
671 - run: ls -R base-build
639 - run: echo ${{ github.sha }} >> build/COMMIT_SHA
640 - run: node ./scripts/tasks/danger
641 - name: Archive sizebot results