Skip to content

Commit 5bf97de

Browse files
authored
chore(ci): support ecosystem-ci use different npm in different repo (#10962)
1 parent 9101e5d commit 5bf97de

File tree

3 files changed

+30
-5
lines changed

3 files changed

+30
-5
lines changed

.github/workflows/ecosystem-ci.yml

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,11 @@ jobs:
5757
uses: ./.github/workflows/reusable-build.yml
5858
with:
5959
target: x86_64-unknown-linux-gnu
60-
runner: ${{ needs.get-runner-labels.outputs.LINUX_RUNNER_LABELS }}
60+
runner: ${{ vars.LINUX_SELF_HOSTED_RUNNER_LABELS || '"ubuntu-22.04"' }}
6161
ref: ${{ github.event_name == 'workflow_dispatch' && format('refs/pull/{0}/head', inputs.pr) || github.sha }}
6262
test: false
6363
bench: false
64+
prefer_docker: false
6465

6566
create-comment:
6667
if: github.repository == 'web-infra-dev/rspack'
@@ -181,19 +182,41 @@ jobs:
181182
cd rspack-ecosystem-ci
182183
pnpm i --frozen-lockfile
183184
185+
pnpm verdaccio --config verdaccio.yaml&
186+
printf '\n//localhost:4873/:_authToken="this-is-a-fake-token"\n' >> ~/.npmrc
187+
184188
mkdir -p ./workspace
185189
ln -s $RSPACK_DIR ./workspace/rspack
186190
191+
cd workspace/rspack
192+
pnpm --filter @rspack/binding... \
193+
--filter @rspack/binding-darwin-arm64... \
194+
--filter @rspack/core... \
195+
--filter @rspack/dev-server... \
196+
--filter @rspack/test-tools... \
197+
--filter @rspack/tracing... \
198+
exec sh -c 'jq ".publishConfig.provenance = false" package.json > package.json.tmp && mv package.json.tmp package.json'
199+
200+
pnpm publish --no-git-checks --provenance=false --access public --registry=http://localhost:4873 \
201+
--filter @rspack/binding... \
202+
--filter @rspack/binding-darwin-arm64... \
203+
--filter @rspack/core... \
204+
--filter @rspack/dev-server... \
205+
--filter @rspack/test-tools... \
206+
--filter @rspack/tracing...
207+
208+
cd ../..
209+
pwd
187210
SUITE='${{ matrix.suite }}'
188211
SUITE_REF='${{ inputs.suiteRef || '-' }}'
189212
CONCLUSION='success'
190213
if [[ "$SUITE_REF" != "-" ]]; then
191214
# run test suite with suiteRef
192-
pnpm tsx ecosystem-ci.ts run-suites --suite-commit "$SUITE_REF" "$SUITE" || CONCLUSION='failure'
215+
NPM_CONFIG_REGISTRY=http://localhost:4873 pnpm tsx ecosystem-ci.ts run-suites --suite-commit "$SUITE_REF" "$SUITE" || CONCLUSION='failure'
193216
echo "finish run $SUITE with $SUITE_REF"
194217
else
195218
# run test suite
196-
pnpm tsx ecosystem-ci.ts run-suites "$SUITE" || CONCLUSION='failure'
219+
NPM_CONFIG_REGISTRY=http://localhost:4873 pnpm tsx ecosystem-ci.ts run-suites "$SUITE" || CONCLUSION='failure'
197220
echo "finish run $SUITE"
198221
fi
199222
echo "{\"conclusion\":\"$CONCLUSION\"}" >> "$RSPACK_DIR/$SUITE.json"

packages/rspack-test-tools/tests/configCases/split-chunks/cache-group-test/rspack.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ module.exports = {
1313
expect(module.size()).toBe(5);
1414
expect(moduleGraph.isAsync(module)).toBe(false);
1515
expect(chunkGraph.getModuleChunks(module).length).toBe(1);
16-
expect(Array.from(chunkGraph.getModuleChunksIterable(module)).length).toBe(1);
16+
expect(
17+
Array.from(chunkGraph.getModuleChunksIterable(module)).length
18+
).toBe(1);
1719
return true;
1820
}
1921
}

packages/rspack/src/util/bindingVersionCheck.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Help:
3434
`;
3535
}
3636

37-
return `Unmatched version @rspack/core@${coreVersion} and @rspack/binding.
37+
return `Unmatched version @rspack/core@${coreVersion} and @rspack/binding@${expectedCoreVersion}.
3838
3939
Help:
4040
Please ensure the version of @rspack/binding and @rspack/core is the same.

0 commit comments

Comments
 (0)