From 569c3b28ee968df58ff3c55be9a8efa2ee72fc82 Mon Sep 17 00:00:00 2001 From: lauren Date: Fri, 7 Feb 2025 16:39:37 -0500 Subject: [PATCH] [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 --- .github/workflows/runtime_build_and_test.yml | 69 +++++--------------- 1 file changed, 18 insertions(+), 51 deletions(-) diff --git a/.github/workflows/runtime_build_and_test.yml b/.github/workflows/runtime_build_and_test.yml index 9a592780b1..12e341a86f 100644 --- a/.github/workflows/runtime_build_and_test.yml +++ b/.github/workflows/runtime_build_and_test.yml @@ -585,52 +585,10 @@ jobs: RELEASE_CHANNEL: experimental # ----- SIZEBOT ----- - download_base_build_for_sizebot: - if: ${{ github.event_name == 'pull_request' && github.ref_name != 'main' }} - name: Download base build for sizebot - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.sha || github.sha }} - - uses: actions/setup-node@v4 - with: - node-version-file: '.nvmrc' - cache: yarn - cache-dependency-path: yarn.lock - - name: Restore cached node_modules - uses: actions/cache@v4 - id: node_modules - with: - path: "**/node_modules" - key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('yarn.lock', 'scripts/release/yarn.lock') }} - - name: Ensure clean build directory - run: rm -rf build - - run: yarn install --frozen-lockfile - - run: yarn install --frozen-lockfile - working-directory: scripts/release - - name: Download artifacts for base revision - run: | - git fetch origin main - GH_TOKEN=${{ github.token }} scripts/release/download-experimental-build.js --commit=$(git rev-parse origin/main) - mv ./build ./base-build - # TODO: The `download-experimental-build` script copies the npm - # packages into the `node_modules` directory. This is a historical - # quirk of how the release script works. Let's pretend they - # don't exist. - - name: Delete extraneous files - run: rm -rf ./base-build/node_modules - - name: Display structure of base-build - run: ls -R base-build - - name: Archive base-build - uses: actions/upload-artifact@v4 - with: - name: base-build - path: base-build - sizebot: + if: ${{ github.event_name == 'pull_request' && github.ref_name != 'main' && github.event.pull_request.base.ref == 'main' }} name: Run sizebot - needs: [build_and_lint, download_base_build_for_sizebot] + needs: [build_and_lint] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -649,6 +607,22 @@ jobs: key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }} - name: Ensure clean build directory run: rm -rf build + - run: yarn install --frozen-lockfile + working-directory: scripts/release + - name: Download artifacts for base revision + run: | + GH_TOKEN=${{ github.token }} scripts/release/download-experimental-build.js --commit=$(git rev-parse ${{ github.event.pull_request.base.sha }}) + mv ./build ./base-build + # TODO: The `download-experimental-build` script copies the npm + # packages into the `node_modules` directory. This is a historical + # quirk of how the release script works. Let's pretend they + # don't exist. + - name: Delete extraneous files + run: rm -rf ./base-build/node_modules + - name: Display structure of base-build from origin/main + run: ls -R base-build + - name: Ensure clean build directory + run: rm -rf build - run: yarn install --frozen-lockfile - name: Restore archived build for PR uses: actions/download-artifact@v4 @@ -662,13 +636,6 @@ jobs: node ./scripts/print-warnings/print-warnings.js > build/__test_utils__/ReactAllWarnings.js - name: Display structure of build for PR run: ls -R build - - name: Restore archived base-build from origin/main - uses: actions/download-artifact@v4 - with: - name: base-build - path: base-build - - name: Display structure of base-build from origin/main - run: ls -R base-build - run: echo ${{ github.sha }} >> build/COMMIT_SHA - run: node ./scripts/tasks/danger - name: Archive sizebot results