Skip to content

Commit 6b754b5

Browse files
committed
feat: parallelize
1 parent a94005a commit 6b754b5

File tree

2 files changed

+115
-66
lines changed

2 files changed

+115
-66
lines changed

.github/workflows/benchmark.yaml

+84-66
Original file line numberDiff line numberDiff line change
@@ -4,91 +4,109 @@ on:
44
workflow_dispatch:
55

66
jobs:
7-
benchmark:
8-
name: 'Benchmark'
9-
10-
env:
11-
COREPACK_ENABLE_STRICT: 0
12-
COREPACK_ENABLE_AUTO_PIN: 0
13-
YARN_ENABLE_IMMUTABLE_INSTALLS: false
14-
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_TOKEN }}
15-
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
16-
TURBO_TEAMID: ${{ secrets.TURBO_TEAMID }}
7+
env:
8+
COREPACK_ENABLE_STRICT: 0
9+
COREPACK_ENABLE_AUTO_PIN: 0
10+
YARN_ENABLE_IMMUTABLE_INSTALLS: false
11+
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_TOKEN }}
12+
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
13+
TURBO_TEAMID: ${{ secrets.TURBO_TEAMID }}
1714

18-
strategy:
19-
fail-fast: false
20-
matrix:
21-
platform:
22-
23-
- name: Linux
24-
os: ubuntu-latest
25-
shell: bash
26-
27-
runs-on: ${{ matrix.platform.os }}
28-
29-
steps:
30-
15+
task:
16+
name: 'Benchmark Running Tasks'
17+
runs-on: ubuntu-latest
18+
steps:
3119
- uses: actions/checkout@v4
32-
3320
- name: Install Node
3421
uses: actions/setup-node@v2
3522
with:
3623
node-version: '22'
37-
3824
- name: Install & Setup Tools
3925
run: |
40-
# Install Package Managers & Benchmark Tools
41-
cargo install hyperfine --quiet
42-
npm install -g npm@latest vlt@latest bun@latest deno@latest --silent
43-
corepack enable yarn pnpm
44-
45-
# Create Results Directory
46-
mkdir -p ./results/
47-
48-
# Log Package Manager Versions
49-
NPM_VERSION="$(npm -v)"
50-
VLT_VERSION="$(vlt -v)"
51-
YARN_VERSION="$(corepack yarn@1 -v)"
52-
BERRY_VERSION="$(corepack yarn@latest -v)"
53-
PNPM_VERSION="$(corepack pnpm@latest -v)"
54-
BUN_VERSION="$(bun -v)"
55-
DENO_VERSION="$(npm view deno@latest version)"
56-
57-
echo "npm: $NPM_VERSION"
58-
echo "vlt: $VLT_VERSION"
59-
echo "yarn: $YARN_VERSION"
60-
echo "berry: $BERRY_VERSION"
61-
echo "pnpm: $PNPM_VERSION"
62-
echo "bun: $BUN_VERSION"
63-
echo "deno: $DENO_VERSION"
64-
65-
echo "{ npm: \"$NPM_VERSION\", vlt: \"$VLT_VERSION\", yarn: \"$YARN_VERSION\", berry: \"$BERRY_VERSION\", pnpm: \"$PNPM_VERSION\", bun: \"$BUN_VERSION\", deno: \"$DENO_VERSION\" }" > ./results/versions.json
66-
67-
# Log Benchmark Configurations
68-
echo "COREPACK_ENABLE_STRICT: ${{ env.COREPACK_ENABLE_STRICT }}"
69-
echo "COREPACK_ENABLE_AUTO_PIN: ${{ env.COREPACK_ENABLE_AUTO_PIN }}"
70-
echo "YARN_ENABLE_IMMUTABLE_INSTALLS: ${{ env.YARN_ENABLE_IMMUTABLE_INSTALLS }}"
71-
72-
- name: Run Task Execution Benchmarks
26+
bash ./scripts/setup.sh
27+
- name: Run Task Execution Benchmarks
7328
run: |
7429
bash ./scripts/run.sh
75-
76-
- name: Run Project Benchmarks (Next)
30+
- name: Upload Benchmark Results
31+
uses: actions/upload-artifact@v4
32+
with:
33+
name: benchmark-results
34+
path: ./results/
35+
next:
36+
name: 'Benchmark Next Project'
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@v4
40+
- name: Install Node
41+
uses: actions/setup-node@v2
42+
with:
43+
node-version: '22'
44+
- name: Install & Setup Tools
45+
run: |
46+
bash ./scripts/setup.sh
47+
- name: Run Project Benchmarks
7748
run: |
7849
bash ./scripts/install.sh next
79-
80-
- name: Run Project Benchmarks (Astro)
50+
- name: Upload Benchmark Results
51+
uses: actions/upload-artifact@v4
52+
with:
53+
name: benchmark-results
54+
path: ./results/
55+
astro:
56+
name: 'Benchmark Astro Project'
57+
runs-on: ubuntu-latest
58+
steps:
59+
- uses: actions/checkout@v4
60+
- name: Install Node
61+
uses: actions/setup-node@v2
62+
with:
63+
node-version: '22'
64+
- name: Install & Setup Tools
65+
run: |
66+
bash ./scripts/setup.sh
67+
- name: Run Project Benchmarks
8168
run: |
8269
bash ./scripts/install.sh astro
83-
84-
- name: Run Project Benchmarks (Svelte)
70+
- name: Upload Benchmark Results
71+
uses: actions/upload-artifact@v4
72+
with:
73+
name: benchmark-results
74+
path: ./results/
75+
svelte:
76+
name: 'Benchmark Svelte Project'
77+
runs-on: ubuntu-latest
78+
steps:
79+
- uses: actions/checkout@v4
80+
- name: Install Node
81+
uses: actions/setup-node@v2
82+
with:
83+
node-version: '22'
84+
- name: Install & Setup Tools
85+
run: |
86+
bash ./scripts/setup.sh
87+
- name: Run Project Benchmarks
8588
run: |
8689
bash ./scripts/install.sh svelte
87-
90+
- name: Upload Benchmark Results
91+
uses: actions/upload-artifact@v4
92+
with:
93+
name: benchmark-results
94+
path: ./results/
95+
vue:
96+
name: 'Benchmark Vue Project'
97+
runs-on: ubuntu-latest
98+
steps:
99+
- uses: actions/checkout@v4
100+
- name: Install Node
101+
uses: actions/setup-node@v2
102+
with:
103+
node-version: '22'
104+
- name: Install & Setup Tools
105+
run: |
106+
bash ./scripts/setup.sh
88107
- name: Run Project Benchmarks (Vue)
89108
run: |
90109
bash ./scripts/install.sh vue
91-
92110
- name: Upload Benchmark Results
93111
uses: actions/upload-artifact@v4
94112
with:

scripts/setup.sh

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Install Package Managers & Benchmark Tools
2+
cargo install hyperfine --quiet
3+
npm install -g npm@latest vlt@latest bun@latest deno@latest --silent
4+
corepack enable yarn pnpm
5+
6+
# Create Results Directory
7+
mkdir -p ./results/
8+
9+
# Log Package Manager Versions
10+
NPM_VERSION="$(npm -v)"
11+
VLT_VERSION="$(vlt -v)"
12+
YARN_VERSION="$(corepack yarn@1 -v)"
13+
BERRY_VERSION="$(corepack yarn@latest -v)"
14+
PNPM_VERSION="$(corepack pnpm@latest -v)"
15+
BUN_VERSION="$(bun -v)"
16+
DENO_VERSION="$(npm view deno@latest version)"
17+
18+
echo "npm: $NPM_VERSION"
19+
echo "vlt: $VLT_VERSION"
20+
echo "yarn: $YARN_VERSION"
21+
echo "berry: $BERRY_VERSION"
22+
echo "pnpm: $PNPM_VERSION"
23+
echo "bun: $BUN_VERSION"
24+
echo "deno: $DENO_VERSION"
25+
26+
echo "{ npm: \"$NPM_VERSION\", vlt: \"$VLT_VERSION\", yarn: \"$YARN_VERSION\", berry: \"$BERRY_VERSION\", pnpm: \"$PNPM_VERSION\", bun: \"$BUN_VERSION\", deno: \"$DENO_VERSION\" }" > ./results/versions.json
27+
28+
# Log Benchmark Configurations
29+
echo "COREPACK_ENABLE_STRICT: ${{ env.COREPACK_ENABLE_STRICT }}"
30+
echo "COREPACK_ENABLE_AUTO_PIN: ${{ env.COREPACK_ENABLE_AUTO_PIN }}"
31+
echo "YARN_ENABLE_IMMUTABLE_INSTALLS: ${{ env.YARN_ENABLE_IMMUTABLE_INSTALLS }}"

0 commit comments

Comments
 (0)