rrc-web/.github/workflows/ci.yml

84 lines
2 KiB
YAML

name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
permissions:
contents: write
jobs:
lint:
name: Lint and Format Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install black ruff mypy isort
- name: Check formatting with Black
run: black --check --line-length 100 rrc_web/
- name: Check import sorting with isort
run: isort --check-only --profile black --line-length 100 rrc_web/
- name: Lint with Ruff
run: ruff check rrc_web/
- name: Type check with mypy
run: mypy rrc_web/
continue-on-error: true
security:
name: Security Scan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install bandit[toml]
- name: Run Bandit security scan
run: bandit -r rrc_web/ -c pyproject.toml
continue-on-error: true
build-frontend:
name: Build Svelte Frontend
runs-on: ubuntu-latest
needs: [lint, security]
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: svelte-frontend/package.json
- name: Install dependencies
working-directory: svelte-frontend
run: npm ci
- name: Build frontend
working-directory: svelte-frontend
run: npm run build