combine results #10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Package Manager Benchmarks | |
on: | |
push: | |
workflow_dispatch: | |
jobs: | |
benchmark: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Install Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '22' | |
- name: Install npm | |
run: npm install -g npm | |
- name: Install yarn | |
run: npm install -g yarn | |
- name: Install pnpm | |
run: npm install -g pnpm | |
- name: Install bun | |
run: curl -fsSL https://bun.sh/install | bash | |
- name: Install deno | |
run: curl -fsSL https://deno.land/x/install/install.sh | sh | |
- name: Install hyperfine | |
run: sudo apt-get install -y hyperfine | |
- name: Benchmark package managers | |
run: | | |
echo "Benchmarking npm (cold cache)..." | |
hyperfine -i --prepare 'rm -rf node_modules package-lock.json .npmrc' 'npm install' --export-markdown npm_cold.md | |
echo "Benchmarking yarn (cold cache)..." | |
hyperfine -i --prepare 'rm -rf node_modules yarn.lock .yarnrc' 'yarn install' --export-markdown yarn_cold.md | |
echo "Benchmarking pnpm (cold cache)..." | |
hyperfine -i --prepare 'rm -rf node_modules pnpm-lock.yaml .npmrc' 'pnpm install' --export-markdown pnpm_cold.md | |
echo "Benchmarking bun (cold cache)..." | |
hyperfine -i --prepare 'rm -rf node_modules bun.lockb' 'bun install' --export-markdown bun_cold.md | |
echo "Benchmarking deno (cold cache)..." | |
hyperfine -i --prepare 'rm -rf deno_modules' 'deno cache' --export-markdown deno_cold.md | |
echo "Combining benchmark results..." | |
echo "# Package Manager Benchmark Results" > combined_results.md | |
echo "## npm (cold cache)" >> combined_results.md | |
cat npm_cold.md >> combined_results.md | |
echo "## yarn (cold cache)" >> combined_results.md | |
cat yarn_cold.md >> combined_results.md | |
echo "## pnpm (cold cache)" >> combined_results.md | |
cat pnpm_cold.md >> combined_results.md | |
echo "## bun (cold cache)" >> combined_results.md | |
cat bun_cold.md >> combined_results.md | |
echo "## deno (cold cache)" >> combined_results.md | |
cat deno_cold.md >> combined_results.md | |
echo "Benchmark Results:" | |
cat combined_results.md |