use corepack #14
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 Tools | |
run: | | |
npm install -g vlt | |
corepack enable yarn pnpm | |
curl -fsSL https://bun.sh/install | bash | |
curl -fsSL https://deno.land/x/install/install.sh | sh | |
sudo apt-get install -y hyperfine | |
- name: Run Benchmarks | |
run: | | |
echo "Benchmarking vlt..." | |
npm -v | |
hyperfine --warmup 3 -i --prepare 'rm -rf node_modules vlt-lock.json' 'vlt install' --export-markdown vlt.md | |
echo "Benchmarking npm..." | |
hyperfine --warmup 3 -i --prepare 'rm -rf node_modules package-lock.json .npmrc' 'npm install' --export-markdown npm.md | |
echo "Benchmarking yarn v1..." | |
hyperfine --warmup 3 -i --prepare 'rm -rf node_modules yarn.lock .yarnrc' 'corepack yarn@1 install' --export-markdown yarn.md | |
echo "Benchmarking yarn v2+..." | |
hyperfine --warmup 3 -i --prepare 'rm -rf node_modules yarn.lock .yarnrc' 'corepack yarn@latest install' --export-markdown yarn2.md | |
echo "Benchmarking pnpm..." | |
hyperfine --warmup 3 -i --prepare 'rm -rf node_modules pnpm-lock.yaml .npmrc' 'corepack pnpm install' --export-markdown pnpm.md | |
echo "Benchmarking bun..." | |
hyperfine --warmup 3 -i --prepare 'rm -rf node_modules package-lock.json bun.lockb' 'bun install' --export-markdown bun.md | |
echo "Benchmarking deno..." | |
hyperfine -i --prepare 'rm -rf node_modules deno.json' 'deno install' --export-markdown deno.md | |
cat vlt.md >> combined_results.md | |
cat npm.md >> combined_results.md | |
cat yarn.md >> combined_results.md | |
cat yarn2.md >> combined_results.md | |
cat pnpm.md >> combined_results.md | |
cat bun.md >> combined_results.md | |
cat deno.md >> combined_results.md | |
cat combined_results.md |