Skip to content

Commit 9f3dbea

Browse files
committed
[ci] Add yarn_test_build job to gh actions
ghstack-source-id: 6df35817371d0d3acf173227d0ac9e377543aa34 Pull Request resolved: #30072
1 parent 7720f1f commit 9f3dbea

File tree

2 files changed

+66
-9
lines changed

2 files changed

+66
-9
lines changed

Diff for: .github/workflows/runtime_build.yml

+65-6
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,72 @@ 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
6161
lint_build:
6262
name: yarn lint-build
63-
needs: [define_build_params, build]
63+
needs: build
64+
runs-on: ubuntu-latest
65+
steps:
66+
- uses: actions/checkout@v4
67+
- uses: actions/setup-node@v4
68+
with:
69+
node-version: 18.x
70+
cache: "yarn"
71+
cache-dependency-path: yarn.lock
72+
- name: Restore cached node_modules
73+
uses: actions/cache@v4
74+
id: node_modules
75+
with:
76+
path: "**/node_modules"
77+
key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }}
78+
- name: Restore archived build
79+
uses: actions/download-artifact@v4
80+
with:
81+
path: build
82+
merge-multiple: true
83+
- name: Display structure of build
84+
run: ls -R build
85+
- run: yarn install --frozen-lockfile
86+
- run: yarn lint-build
87+
88+
test_build:
89+
name: yarn test-build
90+
needs: build
6491
strategy:
6592
matrix:
66-
bundle_type: ${{ fromJSON(needs.define_build_params.outputs.bundle_type) }}
67-
release_channel: ${{ fromJSON(needs.define_build_params.outputs.release_channel) }}
93+
test_params: [
94+
# Intentionally passing these as strings instead of creating a
95+
# separate parameter per CLI argument, since it's easier to
96+
# control/see which combinations we want to run.
97+
-r=stable --env=development,
98+
-r=stable --env=production,
99+
-r=experimental --env=development,
100+
-r=experimental --env=production,
101+
102+
# Dev Tools
103+
--project=devtools -r=experimental,
104+
105+
# TODO: Update test config to support www build tests
106+
# - "-r=www-classic --env=development --variant=false"
107+
# - "-r=www-classic --env=production --variant=false"
108+
# - "-r=www-classic --env=development --variant=true"
109+
# - "-r=www-classic --env=production --variant=true"
110+
# - "-r=www-modern --env=development --variant=false"
111+
# - "-r=www-modern --env=production --variant=false"
112+
# - "-r=www-modern --env=development --variant=true"
113+
# - "-r=www-modern --env=production --variant=true"
114+
115+
# TODO: Update test config to support xplat build tests
116+
# - "-r=xplat --env=development --variant=false"
117+
# - "-r=xplat --env=development --variant=true"
118+
# - "-r=xplat --env=production --variant=false"
119+
# - "-r=xplat --env=production --variant=true"
120+
121+
# TODO: Test more persistent configurations?
122+
]
68123
runs-on: ubuntu-latest
69124
steps:
70125
- uses: actions/checkout@v4
@@ -82,6 +137,10 @@ jobs:
82137
- name: Restore archived build
83138
uses: actions/download-artifact@v4
84139
with:
85-
name: ${{ matrix.bundle_type }}-${{ matrix.release_channel }}
140+
path: build
141+
merge-multiple: true
142+
- name: Display structure of build
143+
run: ls -R build
86144
- run: yarn install --frozen-lockfile
87-
- run: yarn lint-build
145+
- run: yarn test --build ${{ matrix.test_params }} --ci=github
146+

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)