Skip to content

Commit ec06735

Browse files
committed
[ci] Add yarn_test_build job to gh actions
ghstack-source-id: 642200ae95d8bc9009d08f495f1391950054be8c Pull Request resolved: #30072
1 parent cefd776 commit ec06735

File tree

2 files changed

+67
-6
lines changed

2 files changed

+67
-6
lines changed

Diff for: .github/workflows/runtime_build.yml

+66-3
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

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

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)