Skip to content

docs: update README to reflect expanded rule scope beyond web development #42

docs: update README to reflect expanded rule scope beyond web development

docs: update README to reflect expanded rule scope beyond web development #42

Workflow file for this run

name: Cursor Rules Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: [8.3]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: mbstring, xml
coverage: none
tools: composer:v2
- name: Validate PHP syntax
run: |
echo "Validating PHP syntax of installer..."
php -l install.php
- name: Validate installer file exists
run: |
if [ ! -f "install.php" ]; then
echo "Error: install.php not found!"
exit 1
fi
echo "Installer file found:"
ls -la install.php
- name: Prepare test environment
run: |
mkdir -p .tests/temp
mkdir -p .tests/reports
chmod -R 755 .tests
- name: Run individual tests
run: |
cd .tests
# Track test results
FAILED_TESTS=0
echo "Running test-copy.sh..."
chmod +x test-copy.sh
if ! ./test-copy.sh | tee reports/test-copy.log; then
FAILED_TESTS=$((FAILED_TESTS + 1))
fi
echo "Running test-debug.sh..."
chmod +x test-debug.sh
if ! ./test-debug.sh | tee reports/test-debug.log; then
FAILED_TESTS=$((FAILED_TESTS + 1))
fi
echo "Running test-invalid-option.sh..."
chmod +x test-invalid-option.sh
if ! ./test-invalid-option.sh | tee reports/test-invalid-option.log; then
FAILED_TESTS=$((FAILED_TESTS + 1))
fi
echo "Running test-conflicting-options.sh..."
chmod +x test-conflicting-options.sh
if ! ./test-conflicting-options.sh | tee reports/test-conflicting-options.log; then
FAILED_TESTS=$((FAILED_TESTS + 1))
fi
echo "Running test-missing-files.sh..."
chmod +x test-missing-files.sh
if ! ./test-missing-files.sh | tee reports/test-missing-files.log; then
FAILED_TESTS=$((FAILED_TESTS + 1))
fi
echo "Running run-all-tests.sh..."
chmod +x run-all-tests.sh
if ! ./run-all-tests.sh | tee reports/run-all-tests.log; then
FAILED_TESTS=$((FAILED_TESTS + 1))
fi
cd ..
# Exit with failure if any tests failed
if [ $FAILED_TESTS -gt 0 ]; then
echo "❌ $FAILED_TESTS test(s) failed!"
exit 1
fi
- name: Generate test summary
if: always()
run: |
echo "# Cursor Rules Test Results" > test-summary.md
echo "## PHP Version: ${{ matrix.php-version }}" >> test-summary.md
echo "## Test Results" >> test-summary.md
# Check each test result
TESTS_PASSED=0
TESTS_FAILED=0
for test in test-copy test-debug test-invalid-option test-conflicting-options test-missing-files run-all-tests; do
if grep -q "Test completed successfully\|All tests passed\|✓ Test passed\|TEST COMPLETED" .tests/reports/${test}.log; then
echo "- ✅ ${test}: Passed" >> test-summary.md
TESTS_PASSED=$((TESTS_PASSED + 1))
else
echo "- ❌ ${test}: Failed" >> test-summary.md
TESTS_FAILED=$((TESTS_FAILED + 1))
fi
done
echo "## Summary" >> test-summary.md
echo "- Total tests: $((TESTS_PASSED + TESTS_FAILED))" >> test-summary.md
echo "- Passed: ${TESTS_PASSED}" >> test-summary.md
echo "- Failed: ${TESTS_FAILED}" >> test-summary.md
cat test-summary.md
# Store test results for later use
echo "TESTS_FAILED=${TESTS_FAILED}" >> $GITHUB_ENV
- name: Upload test logs
if: always()
uses: actions/upload-artifact@v4
with:
name: test-logs-php-${{ matrix.php-version }}
path: |
.tests/reports/
test-summary.md
retention-days: 7
- name: Check test results
if: always()
run: |
if [ "${TESTS_FAILED:-0}" -gt 0 ]; then
echo "❌ Tests failed! See test-summary.md for details."
exit 1
else
echo "✅ All tests passed!"
fi