fix(sync): cloud download on new device + storage cleanup + setup.sh\β¦ #37
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 β Lint & Health | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| ci: | |
| name: Node ${{ matrix.node }} on ubuntu-latest | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| # engines: node >=18.0.0 | --env-file needs 20.6+ | |
| node: ['20', '22'] | |
| fail-fast: false | |
| steps: | |
| - name: β¬οΈ Checkout | |
| uses: actions/checkout@v4 | |
| - name: π’ Setup Node.js ${{ matrix.node }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node }} | |
| # No cache β zero npm dependencies, no lockfile | |
| - name: β Syntax check β server.mjs | |
| run: node --check server.mjs | |
| - name: β Syntax check β bin/isotope CLI | |
| run: node --check bin/isotope 2>/dev/null && echo "β bin/isotope ok" || echo "β οΈ bin/isotope not checkable (shell script)" | |
| - name: π Schema file sanity check | |
| run: | | |
| echo "=== isotope-complete.sql ===" | |
| echo " Size : $(wc -c < isotope-complete.sql) bytes" | |
| echo " Lines : $(wc -l < isotope-complete.sql)" | |
| echo " Tables : $(grep -c 'CREATE TABLE' isotope-complete.sql)" | |
| echo " Funcs : $(grep -c 'CREATE OR REPLACE FUNCTION' isotope-complete.sql)" | |
| echo " Policies: $(grep -c 'CREATE POLICY' isotope-complete.sql)" | |
| - name: π No hardcoded secrets check | |
| run: | | |
| if grep -rE 'SUPABASE_SERVICE_ROLE_KEY\s*=\s*eyJ' --include="*.mjs" --include="*.js" .; then | |
| echo "β Hardcoded service-role key detected!" | |
| exit 1 | |
| fi | |
| echo "β No hardcoded secrets" | |
| - name: π Required files present | |
| run: | | |
| for f in server.mjs package.json setup.sh setup.bat isotope-complete.sql .env.example; do | |
| test -f "$f" && echo "β $f" || (echo "β $f missing" && exit 1) | |
| done | |
| - name: π Smoke test β server starts and answers /api/health | |
| run: | | |
| SUPABASE_URL=https://placeholder.supabase.co \ | |
| SUPABASE_ANON_KEY=placeholder_anon_key \ | |
| PORT=3099 \ | |
| node server.mjs & | |
| SERVER_PID=$! | |
| echo "Waiting for server (pid $SERVER_PID)..." | |
| sleep 4 | |
| STATUS=$(curl -s -o /dev/null -w "%{http_code}" http://127.0.0.1:3099/api/health 2>/dev/null || echo "000") | |
| kill $SERVER_PID 2>/dev/null || true | |
| echo "Health check HTTP status: $STATUS" | |
| # Accept 200 OK or 5xx (server responded β Supabase placeholder is expected to fail) | |
| case "$STATUS" in | |
| 2*|4*|5*) echo "β Server started and responded" ;; | |
| *) echo "β Server did not respond (got $STATUS)" && exit 1 ;; | |
| esac |