Skip to content

Commit 496ae8b

Browse files
authored
fix(build): scope tsconfig.build.json to src/ for reproducibility (#352)
### Ticket [#351](#351) — `tsconfig.build.json` compiles `scripts/` into `dist/` but release workflow excludes them — rebuild reproducibility breaks ### Description - `tsconfig.build.json` previously used `"include": ["**/*.ts"]`, which compiled `scripts/ci_validate_modification.ts` into `dist/scripts/`. The release workflow (`scripts/prepare-release.sh`) only copies `dist/src/` to the release tag, so anyone rebuilding from source got an extra `dist/scripts/ci_validate_modification.js` not present in the published artifact — failing the Apache Software Foundation's `verify-action-build` reproducibility checker. - Tightened `include` to `["src/**/*.ts"]` so `npm run build` no longer emits `dist/scripts/`. Set `"rootDir": "."` explicitly so `src/index.ts` continues to emit to `dist/src/index.js` (without `rootDir`, narrowing the include set lets TypeScript infer `src/` as the common root and emit flat under `dist/`, breaking the release script's `dist/src/` layout). - CI still needs to run `scripts/ci_validate_modification.ts`. Switched both `.github/workflows/ci.yml` and `.github/workflows/ci-results-repo.yml` from `node ./dist/scripts/ci_validate_modification.js …` to `npx tsx scripts/ci_validate_modification.ts …` (22 occurrences total). Added `tsx` to `devDependencies`. Fixes #351. ### Test scenario - [ ] `rm -rf dist && npm run build` — verify `dist/` contains only `src/` (no `dist/scripts/`). - [ ] `ls dist/src/index.js` — verify the release-shaped layout is preserved. - [ ] `npx tsx scripts/ci_validate_modification.ts` (no args) — verify the script runs and exits non-zero with its usage error (proves CI invocation works). - [ ] `npm test` and `npm run lint` — verify no regressions. - [ ] CI green on this PR — confirms the `tsx`-driven validation step still works across all benchmark jobs. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Updated CI/CD workflows to improve build reliability and consistency. * Added development tooling dependency for enhanced script execution. * Refined build configuration to streamline the compilation process. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent be6703b commit 496ae8b

5 files changed

Lines changed: 795 additions & 27 deletions

File tree

.github/workflows/ci-results-repo.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
fail-on-alert: true
4444
gh-repository: 'github.com/benchmark-action/github-action-benchmark-results'
4545
github-token: ${{ secrets.GITHUB_TOKEN }}
46-
- run: node ./dist/scripts/ci_validate_modification.js before_data.js 'Benchmark.Net Benchmark' './benchmark-data-repository'
46+
- run: npx tsx scripts/ci_validate_modification.ts before_data.js 'Benchmark.Net Benchmark' './benchmark-data-repository'
4747

4848
benchmarkjs:
4949
name: Run JavaScript benchmark example - github.com/benchmark-action/github-action-benchmark-results
@@ -77,7 +77,7 @@ jobs:
7777
fail-on-alert: true
7878
gh-repository: 'github.com/benchmark-action/github-action-benchmark-results'
7979
github-token: ${{ secrets.GITHUB_TOKEN }}
80-
- run: node ./dist/scripts/ci_validate_modification.js before_data.js 'Benchmark.js Benchmark' './benchmark-data-repository'
80+
- run: npx tsx scripts/ci_validate_modification.ts before_data.js 'Benchmark.js Benchmark' './benchmark-data-repository'
8181

8282
catch2-v2-framework:
8383
name: Run Catch2 C++ Benchmark Framework example (v2.x) - github.com/benchmark-action/github-action-benchmark-results
@@ -116,7 +116,7 @@ jobs:
116116
fail-on-alert: true
117117
gh-repository: 'github.com/benchmark-action/github-action-benchmark-results'
118118
github-token: ${{ secrets.GITHUB_TOKEN }}
119-
- run: node ./dist/scripts/ci_validate_modification.js before_data.js 'Catch2 Benchmark' './benchmark-data-repository'
119+
- run: npx tsx scripts/ci_validate_modification.ts before_data.js 'Catch2 Benchmark' './benchmark-data-repository'
120120

121121
catch2-v3-framework:
122122
name: Run Catch2 C++ Benchmark Framework example (v3.x) - github.com/benchmark-action/github-action-benchmark-results
@@ -155,7 +155,7 @@ jobs:
155155
fail-on-alert: true
156156
gh-repository: 'github.com/benchmark-action/github-action-benchmark-results'
157157
github-token: ${{ secrets.GITHUB_TOKEN }}
158-
- run: node ./dist/scripts/ci_validate_modification.js before_data.js 'Catch2 Benchmark (v3)' './benchmark-data-repository'
158+
- run: npx tsx scripts/ci_validate_modification.ts before_data.js 'Catch2 Benchmark (v3)' './benchmark-data-repository'
159159

160160
cpp-framework:
161161
name: Run Google C++ Benchmark Framework example - github.com/benchmark-action/github-action-benchmark-results
@@ -196,7 +196,7 @@ jobs:
196196
fail-on-alert: true
197197
gh-repository: 'github.com/benchmark-action/github-action-benchmark-results'
198198
github-token: ${{ secrets.GITHUB_TOKEN }}
199-
- run: node ./dist/scripts/ci_validate_modification.js before_data.js 'C++ Benchmark' './benchmark-data-repository'
199+
- run: npx tsx scripts/ci_validate_modification.ts before_data.js 'C++ Benchmark' './benchmark-data-repository'
200200

201201
go:
202202
name: Run Go benchmark example - github.com/benchmark-action/github-action-benchmark-results
@@ -233,7 +233,7 @@ jobs:
233233
fail-on-alert: true
234234
gh-repository: 'github.com/benchmark-action/github-action-benchmark-results'
235235
github-token: ${{ secrets.GITHUB_TOKEN }}
236-
- run: node ./dist/scripts/ci_validate_modification.js before_data.js 'Go Benchmark' './benchmark-data-repository'
236+
- run: npx tsx scripts/ci_validate_modification.ts before_data.js 'Go Benchmark' './benchmark-data-repository'
237237

238238
java-jmh:
239239
name: Run JMH Java Benchmark Framework example
@@ -272,7 +272,7 @@ jobs:
272272
fail-on-alert: true
273273
gh-repository: 'github.com/benchmark-action/github-action-benchmark-results'
274274
github-token: ${{ secrets.GITHUB_TOKEN }}
275-
- run: node ./dist/scripts/ci_validate_modification.js before_data.js 'JMH Benchmark' './benchmark-data-repository'
275+
- run: npx tsx scripts/ci_validate_modification.ts before_data.js 'JMH Benchmark' './benchmark-data-repository'
276276

277277
julia-benchmark:
278278
name: Run Julia benchmark example - github.com/benchmark-action/github-action-benchmark-results
@@ -315,7 +315,7 @@ jobs:
315315
fail-on-alert: true
316316
gh-repository: 'github.com/benchmark-action/github-action-benchmark-results'
317317
github-token: ${{ secrets.GITHUB_TOKEN }}
318-
- run: node ./dist/scripts/ci_validate_modification.js before_data.js 'Julia benchmark' './benchmark-data-repository'
318+
- run: npx tsx scripts/ci_validate_modification.ts before_data.js 'Julia benchmark' './benchmark-data-repository'
319319

320320
pytest-benchmark:
321321
name: Run Pytest benchmark example - github.com/benchmark-action/github-action-benchmark-results
@@ -355,7 +355,7 @@ jobs:
355355
fail-on-alert: true
356356
gh-repository: 'github.com/benchmark-action/github-action-benchmark-results'
357357
github-token: ${{ secrets.GITHUB_TOKEN }}
358-
- run: node ./dist/scripts/ci_validate_modification.js before_data.js 'Python Benchmark with pytest-benchmark' './benchmark-data-repository'
358+
- run: npx tsx scripts/ci_validate_modification.ts before_data.js 'Python Benchmark with pytest-benchmark' './benchmark-data-repository'
359359

360360
rust:
361361
name: Run Rust benchmark example - github.com/benchmark-action/github-action-benchmark-results
@@ -390,7 +390,7 @@ jobs:
390390
fail-on-alert: true
391391
gh-repository: 'github.com/benchmark-action/github-action-benchmark-results'
392392
github-token: ${{ secrets.GITHUB_TOKEN }}
393-
- run: node ./dist/scripts/ci_validate_modification.js before_data.js 'Rust Benchmark' './benchmark-data-repository'
393+
- run: npx tsx scripts/ci_validate_modification.ts before_data.js 'Rust Benchmark' './benchmark-data-repository'
394394

395395
rust-criterion-rs-framework:
396396
name: Run Criterion.rs benchmark example - github.com/benchmark-action/github-action-benchmark-results
@@ -425,7 +425,7 @@ jobs:
425425
fail-on-alert: true
426426
gh-repository: 'github.com/benchmark-action/github-action-benchmark-results'
427427
github-token: ${{ secrets.GITHUB_TOKEN }}
428-
- run: node ./dist/scripts/ci_validate_modification.js before_data.js 'Criterion.rs Benchmark' './benchmark-data-repository'
428+
- run: npx tsx scripts/ci_validate_modification.ts before_data.js 'Criterion.rs Benchmark' './benchmark-data-repository'
429429

430430
only-alert-with-cache:
431431
name: Run alert check with actions/cache

.github/workflows/ci.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
summary-always: true
4242
github-token: ${{ secrets.GITHUB_TOKEN }}
4343
comment-on-alert: true
44-
- run: node ./dist/scripts/ci_validate_modification.js before_data.js 'Benchmark.Net Benchmark'
44+
- run: npx tsx scripts/ci_validate_modification.ts before_data.js 'Benchmark.Net Benchmark'
4545

4646
benchmarkjs:
4747
name: Run JavaScript benchmark example
@@ -73,7 +73,7 @@ jobs:
7373
summary-always: true
7474
github-token: ${{ secrets.GITHUB_TOKEN }}
7575
comment-on-alert: true
76-
- run: node ./dist/scripts/ci_validate_modification.js before_data.js 'Benchmark.js Benchmark'
76+
- run: npx tsx scripts/ci_validate_modification.ts before_data.js 'Benchmark.js Benchmark'
7777

7878
catch2-v2-framework:
7979
name: Run Catch2 C++ Benchmark Framework example (v2.x)
@@ -110,7 +110,7 @@ jobs:
110110
summary-always: true
111111
github-token: ${{ secrets.GITHUB_TOKEN }}
112112
comment-on-alert: true
113-
- run: node ./dist/scripts/ci_validate_modification.js before_data.js 'Catch2 Benchmark'
113+
- run: npx tsx scripts/ci_validate_modification.ts before_data.js 'Catch2 Benchmark'
114114

115115
catch2-v3-framework:
116116
name: Run Catch2 C++ Benchmark Framework example (v3.x)
@@ -147,7 +147,7 @@ jobs:
147147
summary-always: true
148148
github-token: ${{ secrets.GITHUB_TOKEN }}
149149
comment-on-alert: true
150-
- run: node ./dist/scripts/ci_validate_modification.js before_data.js 'Catch2 Benchmark (v3)'
150+
- run: npx tsx scripts/ci_validate_modification.ts before_data.js 'Catch2 Benchmark (v3)'
151151

152152
cpp-framework:
153153
name: Run Google C++ Benchmark Framework example
@@ -186,7 +186,7 @@ jobs:
186186
summary-always: true
187187
github-token: ${{ secrets.GITHUB_TOKEN }}
188188
comment-on-alert: true
189-
- run: node ./dist/scripts/ci_validate_modification.js before_data.js 'C++ Benchmark'
189+
- run: npx tsx scripts/ci_validate_modification.ts before_data.js 'C++ Benchmark'
190190

191191
go:
192192
name: Run Go benchmark example
@@ -221,7 +221,7 @@ jobs:
221221
summary-always: true
222222
github-token: ${{ secrets.GITHUB_TOKEN }}
223223
comment-on-alert: true
224-
- run: node ./dist/scripts/ci_validate_modification.js before_data.js 'Go Benchmark'
224+
- run: npx tsx scripts/ci_validate_modification.ts before_data.js 'Go Benchmark'
225225

226226
java-jmh:
227227
name: Run JMH Java Benchmark Framework example
@@ -260,7 +260,7 @@ jobs:
260260
summary-always: true
261261
github-token: ${{ secrets.GITHUB_TOKEN }}
262262
comment-on-alert: true
263-
- run: node ./dist/scripts/ci_validate_modification.js before_data.js 'JMH Benchmark'
263+
- run: npx tsx scripts/ci_validate_modification.ts before_data.js 'JMH Benchmark'
264264

265265
julia-benchmark:
266266
name: Run Julia benchmark example
@@ -301,7 +301,7 @@ jobs:
301301
summary-always: true
302302
github-token: ${{ secrets.GITHUB_TOKEN }}
303303
comment-on-alert: true
304-
- run: node ./dist/scripts/ci_validate_modification.js before_data.js 'Julia benchmark'
304+
- run: npx tsx scripts/ci_validate_modification.ts before_data.js 'Julia benchmark'
305305

306306
pytest-benchmark:
307307
name: Run Pytest benchmark example
@@ -339,7 +339,7 @@ jobs:
339339
summary-always: true
340340
github-token: ${{ secrets.GITHUB_TOKEN }}
341341
comment-on-alert: true
342-
- run: node ./dist/scripts/ci_validate_modification.js before_data.js 'Python Benchmark with pytest-benchmark'
342+
- run: npx tsx scripts/ci_validate_modification.ts before_data.js 'Python Benchmark with pytest-benchmark'
343343

344344
rust:
345345
name: Run Rust benchmark example
@@ -371,7 +371,7 @@ jobs:
371371
summary-always: true
372372
github-token: ${{ secrets.GITHUB_TOKEN }}
373373
comment-on-alert: true
374-
- run: node ./dist/scripts/ci_validate_modification.js before_data.js 'Rust Benchmark'
374+
- run: npx tsx scripts/ci_validate_modification.ts before_data.js 'Rust Benchmark'
375375

376376
rust-criterion-rs-framework:
377377
name: Run Criterion.rs benchmark example
@@ -403,7 +403,7 @@ jobs:
403403
summary-always: true
404404
github-token: ${{ secrets.GITHUB_TOKEN }}
405405
comment-on-alert: true
406-
- run: node ./dist/scripts/ci_validate_modification.js before_data.js 'Criterion.rs Benchmark'
406+
- run: npx tsx scripts/ci_validate_modification.ts before_data.js 'Criterion.rs Benchmark'
407407

408408
only-alert-with-cache:
409409
name: Run alert check with actions/cache

0 commit comments

Comments
 (0)