Skip to content

Commit e32789c

Browse files
Add build artifact verification and fix script error handling
- Add verification step to check build artifacts exist before measuring - Remove unreachable return statement before process.exit(1) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent a09e9b4 commit e32789c

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

.github/workflows/bundle-size.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,25 @@ jobs:
7272
- name: Install base dependencies
7373
run: pnpm install --frozen-lockfile
7474

75-
- name: Build and measure base branch
75+
- name: Build base branch
76+
run: pnpm run build
77+
78+
- name: Verify build artifacts
79+
run: |
80+
missing=0
81+
for pkg in react-on-rails react-on-rails-pro react-on-rails-pro-node-renderer; do
82+
if ! ls packages/$pkg/lib/*.js >/dev/null 2>&1; then
83+
echo "::error::Missing build artifacts in packages/$pkg/lib/"
84+
missing=1
85+
fi
86+
done
87+
if [ $missing -eq 1 ]; then
88+
exit 1
89+
fi
90+
echo "All build artifacts verified"
91+
92+
- name: Measure base branch sizes
7693
run: |
77-
pnpm run build
7894
pnpm exec size-limit --json > /tmp/base-sizes.json
7995
echo "Base branch sizes:"
8096
cat /tmp/base-sizes.json

scripts/bundle-size.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ function readJsonFileOrExit(filePath) {
8888
return readJsonFile(filePath);
8989
} catch (error) {
9090
console.error(`${colors.red}Error reading ${filePath}: ${error.message}${colors.reset}`);
91-
return process.exit(1);
91+
process.exit(1);
9292
}
9393
}
9494

0 commit comments

Comments
 (0)