fix web #4
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" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| jobs: | |
| backend-sanity: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install backend deps (if present) | |
| run: | | |
| python -m pip install --upgrade pip | |
| if [ -f backend/requirements.txt ]; then pip install -r backend/requirements.txt; fi | |
| - name: Python syntax compile (backend or repo) | |
| run: | | |
| if [ -d backend ]; then python -m compileall backend; else python -m compileall .; fi | |
| - name: Run pytest (if tests exist) | |
| run: | | |
| if [ -d backend/tests ] || [ -d tests ]; then | |
| pip install pytest | |
| pytest -q | |
| else | |
| echo "No tests found; skipping." | |
| fi | |
| web-build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Detect web folder | |
| id: detect | |
| run: | | |
| if [ -f web/package.json ]; then echo "dir=web" >> $GITHUB_OUTPUT; exit 0; fi | |
| if [ -f package.json ]; then echo "dir=." >> $GITHUB_OUTPUT; exit 0; fi | |
| echo "dir=none" >> $GITHUB_OUTPUT | |
| - name: Setup Node | |
| if: steps.detect.outputs.dir != 'none' | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| - name: Install & build | |
| if: steps.detect.outputs.dir != 'none' | |
| working-directory: ${{ steps.detect.outputs.dir }} | |
| run: | | |
| npm ci | |
| npm run build |