Skip to content

Commit

Permalink
test: 1
Browse files Browse the repository at this point in the history
  • Loading branch information
Timeless0911 committed Nov 30, 2023
1 parent 171b221 commit a5b32b2
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 17 deletions.
32 changes: 16 additions & 16 deletions .github/workflows/manual.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,21 +96,21 @@ jobs:
- name: 🚀 Run specified benchmark
run: cd scripts && ONLY_INSTALL_SIZE=${{ github.event.inputs.onlyInstallSize }} GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} COMMIT_ID=${{ github.event.inputs.commitId }} pnpm start ${{ matrix.product }} ${{ matrix.case }}

- name: Setup git user
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
# - name: Setup git user
# run: |
# git config --global user.name "github-actions[bot]"
# git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"

- name: Install rsync
run: |
apt-get update && apt-get install -y rsync
# - name: Install rsync
# run: |
# apt-get update && apt-get install -y rsync

- name: Update data
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: data
target-folder: data
git-config-name: gh-pages-bot
git-config-email: 41898282+github-actions[bot]@users.noreply.github.com
clean: false
# - name: Update data
# uses: JamesIves/[email protected]
# with:
# branch: gh-pages
# folder: data
# target-folder: data
# git-config-name: gh-pages-bot
# git-config-email: 41898282+github-actions[bot]@users.noreply.github.com
# clean: false
8 changes: 8 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"@pnpm/lockfile-file": "8.1.4",
"@types/node": "17.0.35",
"@types/fs-extra": "9.0.13",
"detect-libc": "2.0.2",
"get-folder-size": "2.0.1",
"axios": "0.27.2",
"execa": "5.1.1",
Expand Down
20 changes: 19 additions & 1 deletion scripts/src/runners/pnpm-install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
import fastGlob from 'fast-glob';
import { performance } from 'perf_hooks';
import getFolderSize from 'get-folder-size';
import { familySync as getLibcFamilySync } from 'detect-libc';

const getAllDeps = (json: Record<string, Record<string, string>>) => ({
...json.dependencies,
Expand Down Expand Up @@ -99,7 +100,7 @@ const getPkgVersions = async (repoPath: string, pkgJsonPath: string) => {

const setPkgVersion = async (repoPath: string, pkgJsonPath: string) => {
const pkgVersions = await getPkgVersions(repoPath, pkgJsonPath);
const pkgJson = await readJson(pkgJsonPath);
let pkgJson = await readJson(pkgJsonPath);

// override workspace protocol
Object.keys(pkgVersions).forEach(key => {
Expand All @@ -111,11 +112,25 @@ const setPkgVersion = async (repoPath: string, pkgJsonPath: string) => {
}
});

// use supportedArchitectures, see https://github.com/pnpm/pnpm/releases/tag/v8.10.0
pkgJson = {
...pkgJson,
packageManager: '[email protected]',
pnpm: {
supportedArchitectures: {
os: ['linux'],
cpu: ['x64'],
libc: ['glibc'],
},
},
};

await outputJson(pkgJsonPath, pkgJson, { spaces: 2 });
};

const runInstall = async (casePath: string) => {
const coldStartTime = performance.now();
await runCommand(casePath, 'corepack enable && pnpm -v');
await runCommand(
casePath,
'pnpm install --registry https://registry.npmjs.org/',
Expand Down Expand Up @@ -165,6 +180,7 @@ const getDepCount = async (casePath: string) => {
};

export const pnpmInstall = async (productName: string, caseName: string) => {
console.log('getLibcFamilySync: ', getLibcFamilySync());
const repoPath = getRepoPath(getRepoName(productName));
const tempPath = getTempPath(productName);
const casePath = join(tempPath, caseName);
Expand Down Expand Up @@ -192,6 +208,8 @@ export const pnpmInstall = async (productName: string, caseName: string) => {
const installSize = await getInstallSize(casePath);
const depCount = await getDepCount(casePath);

await runCommand(join(casePath, 'node_modules/@rspack'), 'ls -l');

return saveMetrics({
coldInstallTime: coldInstallTime,
hotInstallTime: hotInstallTime,
Expand Down

0 comments on commit a5b32b2

Please sign in to comment.