Restore beautiful emojis for Linux users while keeping Windows compatibility
- Linux/Mac users get lovely ✅ and ⚠️ emojis (because it's 2025!) - Windows users get boring [OK] and [SKIP] text (because Windows sucks at Unicode) - Added OS detection in bash and Python to handle encoding differences - Best of both worlds: beautiful UX for civilized operating systems, compatibility for the rest Fuck you Windows and your cp1252 encoding limitations.
This commit is contained in:
parent
f3c3c7500e
commit
df4ca2f221
66
.github/workflows/ci.yml
vendored
66
.github/workflows/ci.yml
vendored
@ -40,43 +40,77 @@ jobs:
|
|||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: |
|
run: |
|
||||||
|
# Set OS-appropriate emojis
|
||||||
|
if [[ "$RUNNER_OS" == "Windows" ]]; then
|
||||||
|
OK="[OK]"
|
||||||
|
SKIP="[SKIP]"
|
||||||
|
else
|
||||||
|
OK="✅"
|
||||||
|
SKIP="⚠️"
|
||||||
|
fi
|
||||||
|
|
||||||
# Run basic import tests
|
# Run basic import tests
|
||||||
python -c "from mini_rag import CodeEmbedder, ProjectIndexer, CodeSearcher; print('[OK] Core imports successful')"
|
python -c "from mini_rag import CodeEmbedder, ProjectIndexer, CodeSearcher; print('$OK Core imports successful')"
|
||||||
|
|
||||||
# Test basic functionality without venv requirements
|
# Test basic functionality without venv requirements
|
||||||
python -c "
|
python -c "
|
||||||
|
import os
|
||||||
|
ok_emoji = '$OK' if os.name != 'nt' else '[OK]'
|
||||||
|
skip_emoji = '$SKIP' if os.name != 'nt' else '[SKIP]'
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from mini_rag.config import ConfigManager
|
from mini_rag.config import ConfigManager
|
||||||
print('[OK] Config system imports work')
|
print(f'{ok_emoji} Config system imports work')
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f'[SKIP] Config test skipped: {e}')
|
print(f'{skip_emoji} Config test skipped: {e}')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from mini_rag.chunker import CodeChunker
|
from mini_rag.chunker import CodeChunker
|
||||||
print('[OK] Chunker imports work')
|
print(f'{ok_emoji} Chunker imports work')
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f'[SKIP] Chunker test skipped: {e}')
|
print(f'{skip_emoji} Chunker test skipped: {e}')
|
||||||
"
|
"
|
||||||
|
|
||||||
echo "[OK] Core functionality tests completed"
|
echo "$OK Core functionality tests completed"
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Test auto-update system
|
- name: Test auto-update system
|
||||||
run: |
|
run: |
|
||||||
|
# Set OS-appropriate emojis
|
||||||
|
if [[ "$RUNNER_OS" == "Windows" ]]; then
|
||||||
|
OK="[OK]"
|
||||||
|
SKIP="[SKIP]"
|
||||||
|
else
|
||||||
|
OK="✅"
|
||||||
|
SKIP="⚠️"
|
||||||
|
fi
|
||||||
|
|
||||||
python -c "
|
python -c "
|
||||||
|
import os
|
||||||
|
ok_emoji = '$OK' if os.name != 'nt' else '[OK]'
|
||||||
|
skip_emoji = '$SKIP' if os.name != 'nt' else '[SKIP]'
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from mini_rag.updater import UpdateChecker
|
from mini_rag.updater import UpdateChecker
|
||||||
updater = UpdateChecker()
|
updater = UpdateChecker()
|
||||||
print('[OK] Auto-update system available')
|
print(f'{ok_emoji} Auto-update system available')
|
||||||
except ImportError:
|
except ImportError:
|
||||||
print('[SKIP] Auto-update system not available (legacy version)')
|
print(f'{skip_emoji} Auto-update system not available (legacy version)')
|
||||||
"
|
"
|
||||||
|
shell: bash
|
||||||
|
|
||||||
- name: Test CLI commands
|
- name: Test CLI commands
|
||||||
run: |
|
run: |
|
||||||
echo "[OK] Checking for CLI files..."
|
# Set OS-appropriate emojis
|
||||||
|
if [[ "$RUNNER_OS" == "Windows" ]]; then
|
||||||
|
OK="[OK]"
|
||||||
|
else
|
||||||
|
OK="✅"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "$OK Checking for CLI files..."
|
||||||
ls -la rag* || dir rag* || echo "CLI files may not be present"
|
ls -la rag* || dir rag* || echo "CLI files may not be present"
|
||||||
echo "[OK] CLI check completed - this is expected in CI environment"
|
echo "$OK CLI check completed - this is expected in CI environment"
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
security-scan:
|
security-scan:
|
||||||
@ -97,7 +131,7 @@ jobs:
|
|||||||
- name: Run security scan
|
- name: Run security scan
|
||||||
run: |
|
run: |
|
||||||
# Scan for security issues (non-failing)
|
# Scan for security issues (non-failing)
|
||||||
bandit -r . -ll || echo "[OK] Security scan completed"
|
bandit -r . -ll || echo "✅ Security scan completed"
|
||||||
|
|
||||||
auto-update-check:
|
auto-update-check:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -119,10 +153,10 @@ jobs:
|
|||||||
- name: Check for auto-update system
|
- name: Check for auto-update system
|
||||||
run: |
|
run: |
|
||||||
if [ -f "mini_rag/updater.py" ]; then
|
if [ -f "mini_rag/updater.py" ]; then
|
||||||
echo "[OK] Auto-update system present"
|
echo "✅ Auto-update system present"
|
||||||
echo "UPDATE_AVAILABLE=true" >> $GITHUB_ENV
|
echo "UPDATE_AVAILABLE=true" >> $GITHUB_ENV
|
||||||
else
|
else
|
||||||
echo "[SKIP] No auto-update system found"
|
echo "⚠️ No auto-update system found"
|
||||||
echo "UPDATE_AVAILABLE=false" >> $GITHUB_ENV
|
echo "UPDATE_AVAILABLE=false" >> $GITHUB_ENV
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -133,8 +167,8 @@ jobs:
|
|||||||
try:
|
try:
|
||||||
from mini_rag.updater import UpdateChecker
|
from mini_rag.updater import UpdateChecker
|
||||||
updater = UpdateChecker()
|
updater = UpdateChecker()
|
||||||
print(f'[OK] Update system configured for: {updater.github_api_url}')
|
print(f'✅ Update system configured for: {updater.github_api_url}')
|
||||||
print(f'[OK] Check frequency: {updater.check_frequency_hours} hours')
|
print(f'✅ Check frequency: {updater.check_frequency_hours} hours')
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f'[SKIP] Update system validation skipped: {e}')
|
print(f'⚠️ Update system validation skipped: {e}')
|
||||||
"
|
"
|
||||||
Loading…
x
Reference in New Issue
Block a user