From a6b895916965cb6563a5238aa6eccfff984e40b4 Mon Sep 17 00:00:00 2001 From: Lauren Tan Date: Fri, 12 Jul 2024 11:21:09 -0400 Subject: [PATCH] [ci] Add yarn_test_build job to gh actions ghstack-source-id: 5cff9778611acb747c05b9d353bd1af3b11e7d7a Pull Request resolved: https://github.com/facebook/react/pull/30072 --- .github/workflows/runtime_build.yml | 60 +++++++++++++++++++ .../storeStressTestConcurrent-test.js | 2 + 2 files changed, 62 insertions(+) diff --git a/.github/workflows/runtime_build.yml b/.github/workflows/runtime_build.yml index 89eb83ead6270..1543af1c2e51f 100644 --- a/.github/workflows/runtime_build.yml +++ b/.github/workflows/runtime_build.yml @@ -53,6 +53,66 @@ jobs: path: | build + test_build: + name: yarn test-build + needs: build_and_lint + strategy: + matrix: + test_params: [ + # Intentionally passing these as strings instead of creating a + # separate parameter per CLI argument, since it's easier to + # control/see which combinations we want to run. + -r=stable --env=development, + -r=stable --env=production, + -r=experimental --env=development, + -r=experimental --env=production, + + # Dev Tools + --project=devtools -r=experimental, + + # TODO: Update test config to support www build tests + # - "-r=www-classic --env=development --variant=false" + # - "-r=www-classic --env=production --variant=false" + # - "-r=www-classic --env=development --variant=true" + # - "-r=www-classic --env=production --variant=true" + # - "-r=www-modern --env=development --variant=false" + # - "-r=www-modern --env=production --variant=false" + # - "-r=www-modern --env=development --variant=true" + # - "-r=www-modern --env=production --variant=true" + + # TODO: Update test config to support xplat build tests + # - "-r=xplat --env=development --variant=false" + # - "-r=xplat --env=development --variant=true" + # - "-r=xplat --env=production --variant=false" + # - "-r=xplat --env=production --variant=true" + + # TODO: Test more persistent configurations? + ] + continue-on-error: true + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 18.20.1 + 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') }} + - run: yarn install --frozen-lockfile + - name: Restore archived build + uses: actions/download-artifact@v4 + with: + path: build + merge-multiple: true + - name: Display structure of build + run: ls -R build + - run: yarn test --build ${{ matrix.test_params }} --ci=github + process_artifacts_combined: name: Process artifacts combined needs: build_and_lint diff --git a/packages/react-devtools-shared/src/__tests__/storeStressTestConcurrent-test.js b/packages/react-devtools-shared/src/__tests__/storeStressTestConcurrent-test.js index 472ad31671a76..8dd4ce428438f 100644 --- a/packages/react-devtools-shared/src/__tests__/storeStressTestConcurrent-test.js +++ b/packages/react-devtools-shared/src/__tests__/storeStressTestConcurrent-test.js @@ -16,6 +16,8 @@ describe('StoreStressConcurrent', () => { let store; let print; + jest.setTimeout(15000); + beforeEach(() => { global.IS_REACT_ACT_ENVIRONMENT = true;