Merge pull request #12 from GobbyAI/0.4.2 #409
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] | |
| paths-ignore: | |
| - '**.md' | |
| - 'docs/**' | |
| - 'LICENSE*' | |
| - '.gobby/**' | |
| pull_request: | |
| branches: [main] | |
| paths-ignore: | |
| - '**.md' | |
| - 'docs/**' | |
| - 'LICENSE*' | |
| - '.gobby/**' | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| enable-cache: true | |
| - name: Set up Python | |
| run: uv python install 3.13 | |
| - name: Install dependencies | |
| run: uv sync --dev | |
| - name: Run ruff check | |
| run: uv run ruff check src/ | |
| - name: Run ruff format check | |
| run: uv run ruff format --check src/ | |
| lint-frontend: | |
| name: Lint (Frontend) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: 'npm' | |
| cache-dependency-path: web/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| working-directory: web | |
| - name: Run ESLint | |
| run: npm run lint | |
| working-directory: web | |
| typecheck: | |
| name: Type Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| enable-cache: true | |
| - name: Set up Python | |
| run: uv python install 3.13 | |
| - name: Install dependencies | |
| run: uv sync --dev | |
| - name: Run mypy | |
| run: uv run mypy src/ | |
| typecheck-frontend: | |
| name: Type Check (Frontend) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: 'npm' | |
| cache-dependency-path: web/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| working-directory: web | |
| - name: Run TypeScript check | |
| run: npx tsc --noEmit | |
| working-directory: web | |
| test-frontend: | |
| name: Test (Frontend) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: 'npm' | |
| cache-dependency-path: web/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| working-directory: web | |
| - name: Run vitest with coverage | |
| run: npx vitest run --coverage | |
| working-directory: web | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| files: web/coverage/lcov.info | |
| flags: frontend | |
| fail_ci_if_error: false | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| test: | |
| name: Test (Python ${{ matrix.python-version }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.13", "3.14"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| enable-cache: true | |
| - name: Set up Python ${{ matrix.python-version }} | |
| run: uv python install ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: uv sync --dev | |
| - name: Run tests | |
| run: uv run pytest --cov=gobby --cov-report=xml --cov-report=term-missing --cov-fail-under=80 --ignore=tests/voice --ignore=tests/servers/routes/test_voice_routes.py --deselect tests/hooks/test_hooks_context.py::test_session_start_context_injection | |
| - name: Upload coverage to Codecov | |
| if: matrix.python-version == '3.13' | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| files: ./coverage.xml | |
| fail_ci_if_error: false | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| voice-extra: | |
| name: Voice Extra (safetensors rc0) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| enable-cache: true | |
| - name: Set up Python | |
| run: uv python install 3.13 | |
| - name: Install voice extra dependencies | |
| run: uv sync --dev --extra voice | |
| - name: Run focused voice tests | |
| run: uv run pytest tests/voice tests/servers/routes/test_voice_routes.py | |
| security: | |
| name: Security Scan | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| enable-cache: true | |
| - name: Set up Python | |
| run: uv python install 3.13 | |
| - name: Install dependencies | |
| run: uv sync --dev | |
| - name: Run bandit (SAST) | |
| run: uv run bandit -c pyproject.toml -r src/ | |
| - name: Run pip-audit (dependency CVEs) | |
| # CVE-2025-69872: diskcache 5.6.3 (transitive via litellm) - no fix available | |
| # CVE-2026-4539: pygments 2.19.2 (2.19.2 is latest) - no fix available | |
| run: > | |
| uv run pip-audit | |
| --ignore-vuln CVE-2025-69872 | |
| --ignore-vuln CVE-2026-4539 | |
| build: | |
| name: Build Package | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| enable-cache: true | |
| - name: Set up Python | |
| run: uv python install 3.13 | |
| - name: Build package | |
| run: uv build | |
| - name: Check package contents | |
| run: | | |
| uv run python -c " | |
| import glob, tarfile, zipfile | |
| sdists = glob.glob('dist/gobby-*.tar.gz') | |
| wheels = glob.glob('dist/gobby-*.whl') | |
| if not sdists: | |
| raise FileNotFoundError('No dist/gobby-*.tar.gz found') | |
| if not wheels: | |
| raise FileNotFoundError('No dist/gobby-*.whl found') | |
| t = tarfile.open(sdists[0]) | |
| print('\\n'.join(t.getnames()[:20])) | |
| with zipfile.ZipFile(wheels[0]) as wheel: | |
| names = set(wheel.namelist()) | |
| if 'gobby/ui/web/dist/index.html' not in names: | |
| raise FileNotFoundError('Wheel missing gobby/ui/web/dist/index.html') | |
| " |