From e3dc65c26132ab3fb24a0c8b213065e253ff4fd6 Mon Sep 17 00:00:00 2001 From: Rick Hanlon Date: Thu, 5 Jun 2025 18:57:36 -0400 Subject: [PATCH 1/4] [tests] remove pretest compiler script --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index 6ad9211568541..9e7eb8dc5334d 100644 --- a/package.json +++ b/package.json @@ -129,7 +129,6 @@ "lint-build": "node ./scripts/rollup/validate/index.js", "extract-errors": "node scripts/error-codes/extract-errors.js", "postinstall": "node ./scripts/flow/createFlowConfigs.js", - "pretest": "./scripts/react-compiler/build-compiler.sh && ./scripts/react-compiler/link-compiler.sh", "test": "node ./scripts/jest/jest-cli.js", "test-stable": "node ./scripts/jest/jest-cli.js --release-channel=stable", "test-www": "node ./scripts/jest/jest-cli.js --release-channel=www-modern", From 90423350cc2959b6412b2f89b08b23b19067f085 Mon Sep 17 00:00:00 2001 From: Rick Hanlon Date: Thu, 5 Jun 2025 22:52:59 -0400 Subject: [PATCH 2/4] Remove react-hooks from main test config --- .github/workflows/compiler_typescript.yml | 22 ++++++++++++++++++++++ scripts/jest/config.base.js | 1 + 2 files changed, 23 insertions(+) diff --git a/.github/workflows/compiler_typescript.yml b/.github/workflows/compiler_typescript.yml index 6a3b52e21ae57..56f6f73a478fe 100644 --- a/.github/workflows/compiler_typescript.yml +++ b/.github/workflows/compiler_typescript.yml @@ -55,6 +55,28 @@ jobs: - run: yarn install --frozen-lockfile if: steps.node_modules.outputs.cache-hit != 'true' - run: yarn workspace babel-plugin-react-compiler lint + + # Hardcoded to improve parallelism + test-linter: + name: Test eslint-plugin-react-hooks + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + cache: yarn + cache-dependency-path: compiler/yarn.lock + - name: Restore cached node_modules + uses: actions/cache@v4 + id: node_modules + with: + path: | + **/node_modules + key: compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('compiler/yarn.lock') }} + - run: yarn install --frozen-lockfile + if: steps.node_modules.outputs.cache-hit != 'true' + - run: yarn workspace eslint-plugin-react-hooks test # Hardcoded to improve parallelism jest: diff --git a/scripts/jest/config.base.js b/scripts/jest/config.base.js index 15401cbba012e..ba001e165ee04 100644 --- a/scripts/jest/config.base.js +++ b/scripts/jest/config.base.js @@ -5,6 +5,7 @@ module.exports = { modulePathIgnorePatterns: [ '/scripts/rollup/shims/', '/scripts/bench/', + '/packages/eslint-plugin-react-hooks/', ], transform: { '^.+babel-plugin-react-compiler/dist/index.js$': [ From bf775a1a66cd04cd5f159cf5b7e158d0e6616985 Mon Sep 17 00:00:00 2001 From: Rick Hanlon Date: Thu, 5 Jun 2025 22:59:45 -0400 Subject: [PATCH 3/4] Try this --- .github/workflows/compiler_typescript.yml | 22 --------------- .github/workflows/runtime_build_and_test.yml | 28 ++++++++++++++++++++ 2 files changed, 28 insertions(+), 22 deletions(-) diff --git a/.github/workflows/compiler_typescript.yml b/.github/workflows/compiler_typescript.yml index 56f6f73a478fe..6a3b52e21ae57 100644 --- a/.github/workflows/compiler_typescript.yml +++ b/.github/workflows/compiler_typescript.yml @@ -55,28 +55,6 @@ jobs: - run: yarn install --frozen-lockfile if: steps.node_modules.outputs.cache-hit != 'true' - run: yarn workspace babel-plugin-react-compiler lint - - # Hardcoded to improve parallelism - test-linter: - name: Test eslint-plugin-react-hooks - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version-file: '.nvmrc' - cache: yarn - cache-dependency-path: compiler/yarn.lock - - name: Restore cached node_modules - uses: actions/cache@v4 - id: node_modules - with: - path: | - **/node_modules - key: compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('compiler/yarn.lock') }} - - run: yarn install --frozen-lockfile - if: steps.node_modules.outputs.cache-hit != 'true' - - run: yarn workspace eslint-plugin-react-hooks test # Hardcoded to improve parallelism jest: diff --git a/.github/workflows/runtime_build_and_test.yml b/.github/workflows/runtime_build_and_test.yml index 1d0a896984e26..1e53b6ac4de57 100644 --- a/.github/workflows/runtime_build_and_test.yml +++ b/.github/workflows/runtime_build_and_test.yml @@ -280,6 +280,34 @@ jobs: if: steps.node_modules.outputs.cache-hit != 'true' - run: yarn test ${{ matrix.params }} --ci --shard=${{ matrix.shard }} + # Hardcoded to improve parallelism + test-linter: + name: Test eslint-plugin-react-hooks + needs: [runtime_compiler_node_modules_cache] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + cache: yarn + cache-dependency-path: | + yarn.lock + compiler/yarn.lock + - name: Restore cached node_modules + uses: actions/cache@v4 + id: node_modules + with: + path: | + **/node_modules + key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }} + restore-keys: | + runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}- + runtime-and-compiler-node_modules-v6- + - run: yarn install --frozen-lockfile + if: steps.node_modules.outputs.cache-hit != 'true' + - run: yarn workspace eslint-plugin-react-hooks test + # ----- BUILD ----- build_and_lint: name: yarn build and lint From a44ace89489ce7c8782ee016a712e06fb17567c7 Mon Sep 17 00:00:00 2001 From: Rick Hanlon Date: Thu, 5 Jun 2025 23:03:27 -0400 Subject: [PATCH 4/4] and this --- .github/workflows/runtime_build_and_test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/runtime_build_and_test.yml b/.github/workflows/runtime_build_and_test.yml index 1e53b6ac4de57..0d87776d0494a 100644 --- a/.github/workflows/runtime_build_and_test.yml +++ b/.github/workflows/runtime_build_and_test.yml @@ -306,6 +306,7 @@ jobs: runtime-and-compiler-node_modules-v6- - run: yarn install --frozen-lockfile if: steps.node_modules.outputs.cache-hit != 'true' + - run: ./scripts/react-compiler/build-compiler.sh && ./scripts/react-compiler/link-compiler.sh - run: yarn workspace eslint-plugin-react-hooks test # ----- BUILD -----