Skip to content

Commit 840eeda

Browse files
committed
[ci] Add yarn_test_build job to gh actions
ghstack-source-id: 2329f4cb6c03b89e4621fb5141c79695301b6b8e Pull Request resolved: #30072
1 parent 3d4fad5 commit 840eeda

File tree

2 files changed

+68
-5
lines changed

2 files changed

+68
-5
lines changed

Diff for: .github/workflows/runtime_build.yml

+67-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
- name: Archive build
5555
uses: actions/upload-artifact@v4
5656
with:
57-
name: ${{ matrix.bundle_type }}-${{ matrix.release_channel }}
57+
name: ${{ matrix.bundle_type }}_${{ matrix.release_channel }}
5858
path: |
5959
build/**
6060
@@ -82,6 +82,71 @@ jobs:
8282
- name: Restore archived build
8383
uses: actions/download-artifact@v4
8484
with:
85-
name: ${{ matrix.bundle_type }}-${{ matrix.release_channel }}
85+
name: ${{ matrix.bundle_type }}_${{ matrix.release_channel }}
86+
path: build
87+
- name: Display structure of build
88+
run: ls -R build
8689
- run: yarn install --frozen-lockfile
8790
- run: yarn lint-build
91+
92+
test_build:
93+
name: yarn test-build
94+
needs: [define_build_params, build]
95+
strategy:
96+
matrix:
97+
bundle_type: ${{ fromJSON(needs.define_build_params.outputs.bundle_type) }}
98+
release_channel: ${{ fromJSON(needs.define_build_params.outputs.release_channel) }}
99+
test_params: [
100+
# Intentionally passing these as strings instead of creating a
101+
# separate parameter per CLI argument, since it's easier to
102+
# control/see which combinations we want to run.
103+
-r=stable --env=development,
104+
-r=stable --env=production,
105+
-r=experimental --env=development,
106+
-r=experimental --env=production,
107+
108+
# Dev Tools
109+
--project=devtools -r=experimental,
110+
111+
# TODO: Update test config to support www build tests
112+
# - "-r=www-classic --env=development --variant=false"
113+
# - "-r=www-classic --env=production --variant=false"
114+
# - "-r=www-classic --env=development --variant=true"
115+
# - "-r=www-classic --env=production --variant=true"
116+
# - "-r=www-modern --env=development --variant=false"
117+
# - "-r=www-modern --env=production --variant=false"
118+
# - "-r=www-modern --env=development --variant=true"
119+
# - "-r=www-modern --env=production --variant=true"
120+
121+
# TODO: Update test config to support xplat build tests
122+
# - "-r=xplat --env=development --variant=false"
123+
# - "-r=xplat --env=development --variant=true"
124+
# - "-r=xplat --env=production --variant=false"
125+
# - "-r=xplat --env=production --variant=true"
126+
127+
# TODO: Test more persistent configurations?
128+
]
129+
runs-on: ubuntu-latest
130+
steps:
131+
- uses: actions/checkout@v4
132+
- uses: actions/setup-node@v4
133+
with:
134+
node-version: 18.x
135+
cache: "yarn"
136+
cache-dependency-path: yarn.lock
137+
- name: Restore cached node_modules
138+
uses: actions/cache@v4
139+
id: node_modules
140+
with:
141+
path: "**/node_modules"
142+
key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }}
143+
- name: Restore archived build
144+
uses: actions/download-artifact@v4
145+
with:
146+
name: ${{ matrix.bundle_type }}_${{ matrix.release_channel }}
147+
path: build
148+
- name: Display structure of build
149+
run: ls -R build
150+
- run: yarn install --frozen-lockfile
151+
- run: yarn test --build ${{ matrix.test_params }} --ci=github
152+

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();

0 commit comments

Comments
 (0)