Skip to content

Commit 79ed7d1

Browse files
committed
Improve CI test debugging and file counting
- Add step to verify build outputs exist - Improve file counting logic to handle whitespace - Add better error messages with file listings - Use find instead of ls for more reliable counting
1 parent 8e82ce5 commit 79ed7d1

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

.github/workflows/test.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,15 @@ jobs:
3434
- name: Build all outputs
3535
run: bun run build
3636

37+
- name: Verify build outputs exist
38+
run: |
39+
echo "Checking for build outputs..."
40+
ls -la dist/
41+
test -f dist/railsui-stimulus.module.js || (echo "ESM bundle missing!" && exit 1)
42+
test -f dist/railsui-stimulus.cjs || (echo "CJS bundle missing!" && exit 1)
43+
test -d dist/importmap || (echo "Importmap directory missing!" && exit 1)
44+
echo "✓ All build outputs present"
45+
3746
- name: Run tests
3847
run: bun run test
3948

@@ -57,10 +66,15 @@ jobs:
5766
5867
- name: Count importmap files
5968
run: |
60-
COUNT=$(ls -1 dist/importmap/*.js | grep -v ".map" | wc -l)
69+
echo "Checking dist/importmap directory..."
70+
ls -la dist/importmap/ || echo "Directory does not exist!"
71+
echo "Counting JS files (excluding .map files)..."
72+
COUNT=$(find dist/importmap -name "*.js" -not -name "*.map" | wc -l | tr -d ' ')
6173
echo "Importmap JS files: $COUNT"
62-
if [ $COUNT -ne 15 ]; then
74+
if [ "$COUNT" != "15" ]; then
6375
echo "Error: Expected 15 importmap JS files, found $COUNT"
76+
echo "Files found:"
77+
find dist/importmap -name "*.js" -not -name "*.map" || true
6478
exit 1
6579
fi
6680

0 commit comments

Comments
 (0)