From 5429b786e202348c2101973fb5475081f3a4e1dd Mon Sep 17 00:00:00 2001 From: Lauren Tan Date: Thu, 13 Mar 2025 21:53:19 -0400 Subject: [PATCH] Revert "[ci] Update yarn and node_modules cache key (#32603)" This reverts commit 67338703aa52d662998733e58671dc9fe1edae47. --- .github/workflows/runtime_build_and_test.yml | 80 +++++++------------ .../workflows/runtime_eslint_plugin_e2e.yml | 8 +- .github/workflows/runtime_prereleases.yml | 4 +- .../runtime_releases_from_npm_manual.yml | 4 +- .github/workflows/shared_lint.yml | 8 +- package.json | 2 +- scripts/react-compiler/build-compiler.sh | 1 + 7 files changed, 41 insertions(+), 66 deletions(-) diff --git a/.github/workflows/runtime_build_and_test.yml b/.github/workflows/runtime_build_and_test.yml index 272411b302e63..d53e352fbb266 100644 --- a/.github/workflows/runtime_build_and_test.yml +++ b/.github/workflows/runtime_build_and_test.yml @@ -50,13 +50,13 @@ jobs: with: node-version-file: '.nvmrc' cache: yarn - cache-dependency-path: '**/yarn.lock' + cache-dependency-path: yarn.lock - name: Restore cached node_modules uses: actions/cache@v4 id: node_modules with: path: "**/node_modules" - key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} + 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 @@ -74,18 +74,16 @@ jobs: with: node-version-file: '.nvmrc' cache: yarn - cache-dependency-path: '**/yarn.lock' + cache-dependency-path: yarn.lock - name: Restore cached node_modules uses: actions/cache@v4 id: node_modules with: path: "**/node_modules" - key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} + 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 - - run: yarn install --frozen-lockfile - working-directory: compiler - run: | yarn generate-inline-fizz-runtime git diff --quiet || (echo "There was a change to the Fizz runtime. Run `yarn generate-inline-fizz-runtime` and check in the result." && false) @@ -102,18 +100,16 @@ jobs: with: node-version-file: '.nvmrc' cache: yarn - cache-dependency-path: '**/yarn.lock' + cache-dependency-path: yarn.lock - name: Restore cached node_modules uses: actions/cache@v4 id: node_modules with: path: "**/node_modules" - key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} + 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 - - run: yarn install --frozen-lockfile - working-directory: compiler - run: yarn flags # ----- TESTS ----- @@ -157,18 +153,16 @@ jobs: with: node-version-file: '.nvmrc' cache: yarn - cache-dependency-path: '**/yarn.lock' + cache-dependency-path: yarn.lock - name: Restore cached node_modules uses: actions/cache@v4 id: node_modules with: path: "**/node_modules" - key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} + 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 - - run: yarn install --frozen-lockfile - working-directory: compiler - run: yarn test ${{ matrix.params }} --ci --shard=${{ matrix.shard }} # ----- BUILD ----- @@ -189,7 +183,7 @@ jobs: with: node-version-file: '.nvmrc' cache: yarn - cache-dependency-path: '**/yarn.lock' + cache-dependency-path: yarn.lock - uses: actions/setup-java@v4 with: distribution: temurin @@ -199,12 +193,10 @@ jobs: id: node_modules with: path: "**/node_modules" - key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} + 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 - - run: yarn install --frozen-lockfile - working-directory: compiler - run: yarn build --index=${{ matrix.worker_id }} --total=20 --r=${{ matrix.release_channel }} --ci env: CI: github @@ -269,18 +261,16 @@ jobs: with: node-version-file: '.nvmrc' cache: yarn - cache-dependency-path: '**/yarn.lock' + cache-dependency-path: yarn.lock - name: Restore cached node_modules uses: actions/cache@v4 id: node_modules with: path: "**/node_modules" - key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} + 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 - - run: yarn install --frozen-lockfile - working-directory: compiler - name: Restore archived build uses: actions/download-artifact@v4 with: @@ -303,18 +293,16 @@ jobs: with: node-version-file: '.nvmrc' cache: yarn - cache-dependency-path: '**/yarn.lock' + cache-dependency-path: yarn.lock - name: Restore cached node_modules uses: actions/cache@v4 id: node_modules with: path: "**/node_modules" - key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} + 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 - - run: yarn install --frozen-lockfile - working-directory: compiler - name: Restore archived build uses: actions/download-artifact@v4 with: @@ -352,18 +340,16 @@ jobs: with: node-version-file: '.nvmrc' cache: yarn - cache-dependency-path: '**/yarn.lock' + cache-dependency-path: yarn.lock - name: Restore cached node_modules uses: actions/cache@v4 id: node_modules with: path: "**/node_modules" - key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} + 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 - - run: yarn install --frozen-lockfile - working-directory: compiler - name: Restore archived build uses: actions/download-artifact@v4 with: @@ -389,18 +375,16 @@ jobs: with: node-version-file: '.nvmrc' cache: yarn - cache-dependency-path: '**/yarn.lock' + cache-dependency-path: yarn.lock - name: Restore cached node_modules uses: actions/cache@v4 id: node_modules with: path: "**/node_modules" - key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} + 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 - - run: yarn install --frozen-lockfile - working-directory: compiler - name: Restore archived build uses: actions/download-artifact@v4 with: @@ -423,13 +407,13 @@ jobs: with: node-version-file: '.nvmrc' cache: yarn - cache-dependency-path: 'fixtures/dom/yarn.lock' + cache-dependency-path: yarn.lock - name: Restore cached node_modules uses: actions/cache@v4 id: node_modules with: path: "**/node_modules" - key: fixtures_dom-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('fixtures/dom/yarn.lock') }} + key: fixtures_dom-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }} - name: Ensure clean build directory run: rm -rf build - run: yarn install --frozen-lockfile @@ -463,7 +447,7 @@ jobs: with: node-version-file: '.nvmrc' cache: yarn - cache-dependency-path: '**/yarn.lock' + cache-dependency-path: yarn.lock # Fixture copies some built packages from the workroot after install. # That means dependencies of the built packages are not installed. # We need to install dependencies of the workroot to fulfill all dependency constraints @@ -472,12 +456,10 @@ jobs: id: node_modules with: path: "**/node_modules" - key: fixtures_flight-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} + key: fixtures_flight-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }} - name: Ensure clean build directory run: rm -rf build - run: yarn install --frozen-lockfile - - run: yarn install --frozen-lockfile - working-directory: compiler - name: Restore archived build uses: actions/download-artifact@v4 with: @@ -530,18 +512,16 @@ jobs: with: node-version-file: '.nvmrc' cache: yarn - cache-dependency-path: '**/yarn.lock' + cache-dependency-path: yarn.lock - name: Restore cached node_modules uses: actions/cache@v4 id: node_modules with: path: "**/node_modules" - key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} + 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 - - run: yarn install --frozen-lockfile - working-directory: compiler - name: Restore archived build uses: actions/download-artifact@v4 with: @@ -583,18 +563,16 @@ jobs: with: node-version-file: '.nvmrc' cache: yarn - cache-dependency-path: '**/yarn.lock' + cache-dependency-path: yarn.lock - name: Restore cached node_modules uses: actions/cache@v4 id: node_modules with: path: "**/node_modules" - key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} + 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 - - run: yarn install --frozen-lockfile - working-directory: compiler - name: Restore archived build uses: actions/download-artifact@v4 with: @@ -622,13 +600,13 @@ jobs: with: node-version-file: '.nvmrc' cache: yarn - cache-dependency-path: '**/yarn.lock' + cache-dependency-path: yarn.lock - name: Restore cached node_modules uses: actions/cache@v4 id: node_modules with: path: "**/node_modules" - key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} + 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 @@ -648,8 +626,6 @@ jobs: - name: Ensure clean build directory run: rm -rf build - run: yarn install --frozen-lockfile - - run: yarn install --frozen-lockfile - working-directory: compiler - name: Restore archived build for PR uses: actions/download-artifact@v4 with: diff --git a/.github/workflows/runtime_eslint_plugin_e2e.yml b/.github/workflows/runtime_eslint_plugin_e2e.yml index 07bcf16c2354a..f8878548c0597 100644 --- a/.github/workflows/runtime_eslint_plugin_e2e.yml +++ b/.github/workflows/runtime_eslint_plugin_e2e.yml @@ -35,18 +35,16 @@ jobs: with: node-version-file: '.nvmrc' cache: yarn - cache-dependency-path: '**/yarn.lock' + cache-dependency-path: yarn.lock - name: Restore cached node_modules uses: actions/cache@v4 id: node_modules with: - path: "**/node_modules" - key: runtime-eslint_e2e-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} + path: "node_modules" + key: runtime-eslint_e2e-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }} - name: Ensure clean build directory run: rm -rf build - run: yarn install --frozen-lockfile - - run: yarn install --frozen-lockfile - working-directory: compiler - name: Build plugin working-directory: fixtures/eslint-v${{ matrix.eslint_major }} run: node build.mjs diff --git a/.github/workflows/runtime_prereleases.yml b/.github/workflows/runtime_prereleases.yml index 7536519ba3aed..e52bed6bb16bf 100644 --- a/.github/workflows/runtime_prereleases.yml +++ b/.github/workflows/runtime_prereleases.yml @@ -34,13 +34,13 @@ jobs: with: node-version-file: '.nvmrc' cache: yarn - cache-dependency-path: '**/yarn.lock' + cache-dependency-path: yarn.lock - name: Restore cached node_modules uses: actions/cache@v4 id: node_modules with: path: "**/node_modules" - key: runtime-release-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} + key: runtime-release-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'scripts/release/yarn.lock') }} - name: Ensure clean build directory run: rm -rf build - run: yarn install --frozen-lockfile diff --git a/.github/workflows/runtime_releases_from_npm_manual.yml b/.github/workflows/runtime_releases_from_npm_manual.yml index e0a9630277d27..c0b3867e03da0 100644 --- a/.github/workflows/runtime_releases_from_npm_manual.yml +++ b/.github/workflows/runtime_releases_from_npm_manual.yml @@ -66,13 +66,13 @@ jobs: with: node-version-file: '.nvmrc' cache: yarn - cache-dependency-path: '**/yarn.lock' + cache-dependency-path: yarn.lock - name: Restore cached node_modules uses: actions/cache@v4 id: node_modules with: path: "**/node_modules" - key: runtime-release-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} + key: runtime-release-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'scripts/release/yarn.lock') }} - name: Ensure clean build directory run: rm -rf build - run: yarn install --frozen-lockfile diff --git a/.github/workflows/shared_lint.yml b/.github/workflows/shared_lint.yml index a492a320d41c9..4b077eff65ab5 100644 --- a/.github/workflows/shared_lint.yml +++ b/.github/workflows/shared_lint.yml @@ -24,7 +24,7 @@ jobs: with: node-version-file: '.nvmrc' cache: yarn - cache-dependency-path: '**/yarn.lock' + cache-dependency-path: yarn.lock - name: Restore cached node_modules uses: actions/cache@v4 with: @@ -44,7 +44,7 @@ jobs: with: node-version-file: '.nvmrc' cache: yarn - cache-dependency-path: '**/yarn.lock' + cache-dependency-path: yarn.lock - name: Restore cached node_modules uses: actions/cache@v4 with: @@ -64,7 +64,7 @@ jobs: with: node-version-file: '.nvmrc' cache: yarn - cache-dependency-path: '**/yarn.lock' + cache-dependency-path: yarn.lock - name: Restore cached node_modules uses: actions/cache@v4 with: @@ -84,7 +84,7 @@ jobs: with: node-version-file: '.nvmrc' cache: yarn - cache-dependency-path: '**/yarn.lock' + cache-dependency-path: yarn.lock - name: Restore cached node_modules uses: actions/cache@v4 with: diff --git a/package.json b/package.json index ca0b62e84672d..2c7041f0fbc83 100644 --- a/package.json +++ b/package.json @@ -118,7 +118,7 @@ "testRegex": "/scripts/jest/dont-run-jest-directly\\.js$" }, "scripts": { - "prebuild": "./scripts/react-compiler/link-compiler.sh", + "prebuild": "yarn --cwd compiler install --frozen-lockfile && ./scripts/react-compiler/link-compiler.sh", "build": "node ./scripts/rollup/build-all-release-channels.js", "build-for-devtools": "cross-env RELEASE_CHANNEL=experimental yarn build react/index,react/jsx,react/compiler-runtime,react-dom/index,react-dom/client,react-dom/unstable_testing,react-dom/test-utils,react-is,react-debug-tools,scheduler,react-test-renderer,react-refresh,react-art --type=NODE", "build-for-devtools-dev": "yarn build-for-devtools --type=NODE_DEV", diff --git a/scripts/react-compiler/build-compiler.sh b/scripts/react-compiler/build-compiler.sh index f73258646266d..1c65fdcaa66c9 100755 --- a/scripts/react-compiler/build-compiler.sh +++ b/scripts/react-compiler/build-compiler.sh @@ -11,4 +11,5 @@ if [[ "$REACT_CLASS_EQUIVALENCE_TEST" == "true" ]]; then fi echo "Building babel-plugin-react-compiler..." +yarn --cwd compiler install --frozen-lockfile yarn --cwd compiler workspace babel-plugin-react-compiler build --dts