Skip to content

Commit 68aa1ed

Browse files
committed
[ci] Add yarn_test_build job to gh actions
ghstack-source-id: a69f045720f4fe61ead4069ffdfb700288d630c9 Pull Request resolved: #30072
1 parent 72e97f7 commit 68aa1ed

File tree

5 files changed

+79
-24
lines changed

5 files changed

+79
-24
lines changed

Diff for: .github/workflows/runtime_build.yml

+74-5
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
id: define_release_channels
2727
with:
2828
script: |
29-
return ['stable', 'experimental'];
29+
return ["stable", "experimental"];
3030
3131
build:
3232
name: yarn build
@@ -51,12 +51,16 @@ jobs:
5151
key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }}
5252
- run: yarn install --frozen-lockfile
5353
- run: yarn build --b=${{ matrix.bundle_type }} --r=${{ matrix.release_channel }} --ci=github
54+
env:
55+
CI: github
56+
- name: Display structure of build
57+
run: ls -R build
5458
- name: Archive build
5559
uses: actions/upload-artifact@v4
5660
with:
57-
name: ${{ matrix.bundle_type }}-${{ matrix.release_channel }}
61+
name: ${{ matrix.bundle_type }}_${{ matrix.release_channel }}
5862
path: |
59-
build/**
63+
build
6064
6165
lint_build:
6266
name: yarn lint-build
@@ -65,6 +69,7 @@ jobs:
6569
matrix:
6670
bundle_type: ${{ fromJSON(needs.define_build_params.outputs.bundle_type) }}
6771
release_channel: ${{ fromJSON(needs.define_build_params.outputs.release_channel) }}
72+
continue-on-error: true
6873
runs-on: ubuntu-latest
6974
steps:
7075
- uses: actions/checkout@v4
@@ -79,9 +84,73 @@ jobs:
7984
with:
8085
path: "**/node_modules"
8186
key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }}
87+
- run: yarn install --frozen-lockfile
8288
- name: Restore archived build
8389
uses: actions/download-artifact@v4
8490
with:
85-
name: ${{ matrix.bundle_type }}-${{ matrix.release_channel }}
86-
- run: yarn install --frozen-lockfile
91+
name: ${{ matrix.bundle_type }}_${{ matrix.release_channel }}
92+
path: build
93+
- name: Display structure of build
94+
run: ls -R build
8795
- run: yarn lint-build
96+
97+
test_build:
98+
name: yarn test-build
99+
needs: build
100+
strategy:
101+
matrix:
102+
test_params: [
103+
# Intentionally passing these as strings instead of creating a
104+
# separate parameter per CLI argument, since it's easier to
105+
# control/see which combinations we want to run.
106+
-r=stable --env=development,
107+
-r=stable --env=production,
108+
-r=experimental --env=development,
109+
-r=experimental --env=production,
110+
111+
# Dev Tools
112+
--project=devtools -r=experimental,
113+
114+
# TODO: Update test config to support www build tests
115+
# - "-r=www-classic --env=development --variant=false"
116+
# - "-r=www-classic --env=production --variant=false"
117+
# - "-r=www-classic --env=development --variant=true"
118+
# - "-r=www-classic --env=production --variant=true"
119+
# - "-r=www-modern --env=development --variant=false"
120+
# - "-r=www-modern --env=production --variant=false"
121+
# - "-r=www-modern --env=development --variant=true"
122+
# - "-r=www-modern --env=production --variant=true"
123+
124+
# TODO: Update test config to support xplat build tests
125+
# - "-r=xplat --env=development --variant=false"
126+
# - "-r=xplat --env=development --variant=true"
127+
# - "-r=xplat --env=production --variant=false"
128+
# - "-r=xplat --env=production --variant=true"
129+
130+
# TODO: Test more persistent configurations?
131+
]
132+
continue-on-error: true
133+
runs-on: ubuntu-latest
134+
steps:
135+
- uses: actions/checkout@v4
136+
- uses: actions/setup-node@v4
137+
with:
138+
node-version: 18.x
139+
cache: "yarn"
140+
cache-dependency-path: yarn.lock
141+
- name: Restore cached node_modules
142+
uses: actions/cache@v4
143+
id: node_modules
144+
with:
145+
path: "**/node_modules"
146+
key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }}
147+
- run: yarn install --frozen-lockfile
148+
- name: Restore archived build
149+
uses: actions/download-artifact@v4
150+
with:
151+
path: build
152+
merge-multiple: true
153+
- name: Display structure of build
154+
run: ls -R build
155+
- run: yarn test --build ${{ matrix.test_params }} --ci=github
156+

Diff for: packages/react-devtools-shared/src/__tests__/storeStressTestConcurrent-test.js

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ describe('StoreStressConcurrent', () => {
1616
let store;
1717
let print;
1818

19+
jest.setTimeout(15000);
20+
1921
beforeEach(() => {
2022
global.IS_REACT_ACT_ENVIRONMENT = true;
2123

Diff for: packages/shared/ReactVersion.js

+1-15
Original file line numberDiff line numberDiff line change
@@ -1,15 +1 @@
1-
/**
2-
* Copyright (c) Meta Platforms, Inc. and affiliates.
3-
*
4-
* This source code is licensed under the MIT license found in the
5-
* LICENSE file in the root directory of this source tree.
6-
*/
7-
8-
// TODO: this is special because it gets imported during build.
9-
//
10-
// It exists as a placeholder so that DevTools can support work tag changes between releases.
11-
// When we next publish a release, update the matching TODO in backend/renderer.js
12-
// TODO: This module is used both by the release scripts and to expose a version
13-
// at runtime. We should instead inject the version number as part of the build
14-
// process, and use the ReactVersions.js module as the single source of truth.
15-
export default '19.0.0';
1+
export default '19.0.0-rc-3a600d54b3-20240624';

Diff for: scripts/rollup/build-ghaction.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -846,9 +846,7 @@ async function buildEverything(bundleTypeToBuild) {
846846
);
847847

848848
await Promise.all(
849-
bundles.map(([bundle, bundleType]) => {
850-
return createBundle(bundle, bundleType);
851-
})
849+
bundles.map(([bundle, bundleType]) => createBundle(bundle, bundleType))
852850
);
853851

854852
await Packaging.copyAllShims();

Diff for: scripts/rollup/stats.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const currentBuildResults = {
1818
};
1919

2020
function saveResults() {
21-
if (process.env.CIRCLE_NODE_TOTAL) {
21+
if (process.env.CIRCLE_NODE_TOTAL || process.env.CI === 'github') {
2222
// In CI, write the bundle sizes to a subdirectory and append the node index
2323
// to the filename. A downstream job will consolidate these into a
2424
// single file.

0 commit comments

Comments
 (0)