ci: fix build (track lib/api.ts), fix npm audit (HTTPS registry + aud… #3
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] | |
| permissions: | |
| contents: read | |
| jobs: | |
| # ────────────────────────────────────────────── | |
| # Frontend | |
| # ────────────────────────────────────────────── | |
| frontend-ci: | |
| name: "Frontend · Lint & Build" | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: web | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| cache-dependency-path: web/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Lint | |
| continue-on-error: true | |
| run: npm run lint | |
| - name: Build | |
| run: npm run build | |
| frontend-audit: | |
| name: "Frontend · Dependency Audit" | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: web | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| cache-dependency-path: web/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Audit dependencies | |
| run: npm audit --audit-level=high | |
| # ────────────────────────────────────────────── | |
| # Backend | |
| # ────────────────────────────────────────────── | |
| backend-ci: | |
| name: "Backend · Lint & Test" | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: server | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.14" | |
| - uses: astral-sh/setup-uv@v6 | |
| - name: Install dependencies | |
| run: uv sync --dev | |
| - name: Run tests | |
| run: uv run pytest -v | |
| backend-audit: | |
| name: "Backend · Dependency Audit" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.14" | |
| - uses: astral-sh/setup-uv@v6 | |
| - name: Install dependencies | |
| working-directory: server | |
| run: | | |
| uv sync --dev | |
| uv pip install pip | |
| - uses: pypa/gh-action-pip-audit@v1.1.0 | |
| with: | |
| virtual-environment: server/.venv | |
| # ecdsa maintainer considers side-channel attacks out of scope (CVE-2024-23342) | |
| ignore-vulns: | | |
| GHSA-wj6h-64fc-37mp | |
| # ────────────────────────────────────────────── | |
| # CodeQL – Static Analysis (both languages) | |
| # ────────────────────────────────────────────── | |
| codeql: | |
| name: "CodeQL · Security Scan" | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| security-events: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| language: [javascript-typescript, python] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Initialize CodeQL | |
| uses: github/codeql-action/init@v4 | |
| with: | |
| languages: ${{ matrix.language }} | |
| - name: Autobuild | |
| uses: github/codeql-action/autobuild@v4 | |
| - name: Perform CodeQL Analysis | |
| uses: github/codeql-action/analyze@v4 | |
| with: | |
| category: "/language:${{ matrix.language }}" |