Initial commit: open-source AI writing assistant #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main, develop] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| validate: | |
| name: Validate Extension | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Validate manifest.json | |
| run: | | |
| echo "=== manifest.json ===" | |
| python3 -m json.tool manifest.json | |
| echo "✓ Valid JSON" | |
| MV=$(jq -r '.manifest_version' manifest.json) | |
| [ "$MV" = "3" ] && echo "✓ Manifest V3" || { echo "✗ Expected manifest_version 3"; exit 1; } | |
| echo "Extension: $(jq -r '.name' manifest.json) v$(jq -r '.version' manifest.json)" | |
| - name: Check JS syntax | |
| run: | | |
| node --check background.js && echo "✓ background.js" | |
| node --check content.js && echo "✓ content.js" | |
| node --check popup/popup.js && echo "✓ popup/popup.js" | |
| node --check options/options.js && echo "✓ options/options.js" | |
| - name: Check all required files exist | |
| run: | | |
| REQUIRED=( | |
| manifest.json | |
| background.js | |
| content.js | |
| popup/popup.html | |
| popup/popup.js | |
| popup/popup.css | |
| options/options.html | |
| options/options.js | |
| options/options.css | |
| ) | |
| FAILED=0 | |
| for f in "${REQUIRED[@]}"; do | |
| if [ -f "$f" ]; then | |
| echo "✓ $f" | |
| else | |
| echo "✗ MISSING: $f" | |
| FAILED=1 | |
| fi | |
| done | |
| [ $FAILED -eq 0 ] || exit 1 | |
| - name: Check icon files exist | |
| run: | | |
| ICONS=(icons/icon16.png icons/icon32.png icons/icon48.png icons/icon128.png) | |
| MISSING=0 | |
| for icon in "${ICONS[@]}"; do | |
| if [ -f "$icon" ]; then | |
| echo "✓ $icon" | |
| else | |
| echo "⚠ Missing icon: $icon (run icons/generate-icons.html to create)" | |
| MISSING=1 | |
| fi | |
| done | |
| # Warn but don't fail CI for missing icons (they're gitignored until generated) | |
| [ $MISSING -eq 0 ] || echo "::warning::Some icons are missing. Generate them with icons/generate-icons.html" | |
| - name: Check host_permissions cover all providers | |
| run: | | |
| PERMS=$(jq -r '.host_permissions[]' manifest.json) | |
| for HOST in "api.openai.com" "api.anthropic.com" "openrouter.ai"; do | |
| echo "$PERMS" | grep -q "$HOST" \ | |
| && echo "✓ host_permissions includes $HOST" \ | |
| || { echo "✗ Missing host_permission for $HOST"; exit 1; } | |
| done | |
| - name: Test ZIP build | |
| run: | | |
| mkdir -p dist | |
| zip -r dist/writewise-test.zip . \ | |
| --exclude "*.git*" \ | |
| --exclude ".github/*" \ | |
| --exclude "dist/*" \ | |
| --exclude ".claude/*" \ | |
| --exclude "icons/generate-icons.html" \ | |
| --exclude "node_modules/*" \ | |
| --exclude "*.md" \ | |
| --exclude "package*.json" | |
| echo "✓ ZIP built: $(du -sh dist/writewise-test.zip | cut -f1)" | |
| unzip -l dist/writewise-test.zip | grep -E "manifest|background|content|popup|options" |