Skip to content

Commit 6ba53d4

Browse files
committed
refactor: Move benchmark-json.ts to scripts directory and update references
- Deleted the standalone benchmark-json.ts file and moved its contents to scripts/benchmark-json.ts for better organization. - Updated package.json and README.md to reflect the new file path. - Adjusted tsconfig.scripts.json to exclude the old benchmark-json.ts file. - Removed turbo-graph.png as it is no longer needed. This refactor improves project structure and maintainability.
1 parent c12d4c7 commit 6ba53d4

File tree

9 files changed

+633
-23
lines changed

9 files changed

+633
-23
lines changed

.github/workflows/daily-benchmark.yml

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ jobs:
6262
runs-on: ubuntu-latest
6363
needs: setup
6464
if: ${{ !inputs.skip_benchmark }}
65+
strategy:
66+
fail-fast: false
67+
matrix:
68+
tool: [nx, turbo, lerna, lage, moon]
6569
outputs:
6670
results-available: ${{ steps.benchmark.conclusion == 'success' }}
6771
steps:
@@ -98,16 +102,16 @@ jobs:
98102
name: built-scripts
99103
path: dist/
100104

101-
- name: Run benchmark with JSON output
105+
- name: Run benchmark for ${{ matrix.tool }}
102106
id: benchmark
103107
run: |
104-
node dist/benchmark-json.js > benchmark-results.json
108+
node dist/benchmark-single-tool.js ${{ matrix.tool }} > benchmark-results-${{ matrix.tool }}.json
105109
106-
- name: Upload benchmark results
110+
- name: Upload benchmark results for ${{ matrix.tool }}
107111
uses: actions/upload-artifact@v4
108112
with:
109-
name: benchmark-results
110-
path: benchmark-results.json
113+
name: benchmark-results-${{ matrix.tool }}
114+
path: benchmark-results-${{ matrix.tool }}.json
111115
retention-days: 1
112116

113117
analysis:
@@ -143,7 +147,13 @@ jobs:
143147
if: ${{ !inputs.skip_benchmark }}
144148
uses: actions/download-artifact@v4
145149
with:
146-
name: benchmark-results
150+
pattern: benchmark-results-*
151+
merge-multiple: true
152+
153+
- name: Combine benchmark results
154+
if: ${{ !inputs.skip_benchmark }}
155+
run: |
156+
node dist/scripts/combine-results.js > benchmark-results.json
147157
148158
- name: Read current results
149159
if: ${{ !inputs.skip_benchmark }}
@@ -240,7 +250,13 @@ jobs:
240250
if: ${{ !inputs.skip_benchmark }}
241251
uses: actions/download-artifact@v4
242252
with:
243-
name: benchmark-results
253+
pattern: benchmark-results-*
254+
merge-multiple: true
255+
256+
- name: Combine benchmark results for commit
257+
if: ${{ !inputs.skip_benchmark }}
258+
run: |
259+
node dist/scripts/combine-results.js > benchmark-results.json
244260
245261
- name: Commit and push changes
246262
if: needs.analysis.outputs.readme-updated == 'true'

.github/workflows/test-automation.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,11 @@ on:
55
branches: [main]
66
paths:
77
- 'scripts/**'
8-
- 'benchmark-json.ts'
9-
- 'benchmark-json.js'
108
- '.github/workflows/**'
119
pull_request:
1210
branches: [main]
1311
paths:
1412
- 'scripts/**'
15-
- 'benchmark-json.ts'
16-
- 'benchmark-json.js'
1713
- '.github/workflows/**'
1814
workflow_dispatch:
1915

@@ -41,8 +37,8 @@ jobs:
4137

4238
- name: Test TypeScript source files exist
4339
run: |
44-
test -f benchmark-json.ts
45-
echo "✅ benchmark-json.ts exists"
40+
test -f scripts/benchmark-json.ts
41+
echo "✅ scripts/benchmark-json.ts exists"
4642
test -f scripts/compare-and-update-readme.ts
4743
echo "✅ compare-and-update-readme.ts exists"
4844

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ The automation scripts are built with TypeScript for better type safety and deve
118118

119119
**File Structure:**
120120

121-
* **`benchmark-json.ts`** - TypeScript version with strict types
121+
* **`scripts/benchmark-json.ts`** - TypeScript version with strict types
122122
* **`scripts/compare-and-update-readme.ts`** - Compares results and updates README
123123
* **`scripts/create-release.ts`** - Generates GitHub releases with version-based tags
124124
* **`scripts/test-compare.ts`** - Test suite for automation functions

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
"version": "1.0.0",
44
"private": true,
55
"scripts": {
6-
"benchmark": "tsx benchmark-json.ts",
7-
"benchmark:json": "pnpm run build:scripts && node dist/benchmark-json.js",
8-
"benchmark:json:ts": "tsx benchmark-json.ts",
6+
"benchmark": "tsx scripts/benchmark-json.ts",
7+
"benchmark:json": "pnpm run build:scripts && node dist/scripts/benchmark-json.js",
8+
"benchmark:json:ts": "tsx scripts/benchmark-json.ts",
99
"build:scripts": "tsc -p tsconfig.scripts.json",
1010
"build:scripts:watch": "tsc -p tsconfig.scripts.json --watch",
1111
"test:automation": "pnpm run build:scripts && node dist/scripts/test-compare.js",
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
import * as cp from 'node:child_process';
22
import * as os from 'node:os';
33
import * as path from 'node:path';
4-
import type {
5-
BenchmarkResults,
6-
SpawnResult,
7-
ToolResults,
8-
} from './scripts/types';
4+
import type { BenchmarkResults, SpawnResult, ToolResults } from './types';
95

106
const NUMBER_OF_RUNS = 10;
117
const NUMBER_OF_PREP_RUNS = 2;

0 commit comments

Comments
 (0)