fix(ci): ensure parser is built before testing in GitHub workflows

- Add explicit parser build step before sample code testing
- Remove --scope parameter that requires parser to be compiled first
- Fix tree-sitter CLI v0.25.0 compatibility issue in CI environment

The issue was that tree-sitter CLI v0.25.0 requires the parser to be
compiled before it can recognize custom language scopes. This fix
ensures the parser is always built before attempting to parse test files,
resolving the 'Unknown scope' error in GitHub Actions.
This commit is contained in:
2025-09-13 04:13:38 +03:00
parent b88b851a74
commit c5334da82f

View File

@@ -87,6 +87,9 @@ jobs:
- name: Test Parser with Sample Code
run: |
# Ensure parser is built
npm run build
cat << 'EOF' > test_sample.shellspec
#!/usr/bin/env shellspec
@@ -124,7 +127,7 @@ jobs:
End
EOF
npx tree-sitter parse --scope=source.shellspec test_sample.shellspec --quiet || {
npx tree-sitter parse test_sample.shellspec --quiet || {
echo "❌ Parser failed on sample ShellSpec code"
exit 1
}