Skip to content

chore: Update license from Business Source License to MIT #11

chore: Update license from Business Source License to MIT

chore: Update license from Business Source License to MIT #11

Workflow file for this run

name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
env:
PYTHON_VERSION: "3.12"
NODE_VERSION: "20"
jobs:
# ---------- Backend ----------
backend-lint:
name: Backend Lint
runs-on: ubuntu-latest
defaults:
run:
working-directory: backend
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: pip
- name: Install dependencies
run: |
pip install --upgrade pip
pip install -r requirements.txt -r requirements-test.txt
- name: Ruff lint
run: ruff check .
- name: Ruff format check
run: ruff format --check .
- name: MyPy type check
run: mypy app/ services/ api/ --ignore-missing-imports
backend-security:
name: Backend Security
runs-on: ubuntu-latest
defaults:
run:
working-directory: backend
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: pip
- name: Install dependencies
run: |
pip install --upgrade pip
pip install -r requirements.txt -r requirements-test.txt
- name: Bandit security scan
run: bandit -r app/ services/ api/ gateway/ skills/ -c pyproject.toml
- name: Dependency audit
run: pip-audit --strict --desc
backend-test:
name: Backend Tests
runs-on: ubuntu-latest
defaults:
run:
working-directory: backend
services:
redis:
image: redis:7-alpine
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: pip
- name: Install dependencies
run: |
pip install --upgrade pip
pip install -r requirements.txt -r requirements-test.txt
- name: Run tests
env:
GPS_ENVIRONMENT: testing
GPS_REDIS_URL: redis://localhost:6379/15
GPS_SESSION_SECRET_KEY: ci-test-secret-key-minimum-32-characters
GPS_DATABASE_URL: sqlite+aiosqlite:///test.db
run: pytest --tb=short -q
# ---------- Frontend ----------
frontend-lint:
name: Frontend Lint & Type Check
runs-on: ubuntu-latest
defaults:
run:
working-directory: frontend
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
cache-dependency-path: frontend/package-lock.json
- name: Install dependencies
run: npm ci --legacy-peer-deps
- name: TypeScript type check
run: npx tsc --noEmit
frontend-build:
name: Frontend Build
runs-on: ubuntu-latest
needs: frontend-lint
defaults:
run:
working-directory: frontend
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
cache-dependency-path: frontend/package-lock.json
- name: Install dependencies
run: npm ci --legacy-peer-deps
- name: Build
run: npx next build
env:
NEXT_PUBLIC_API_URL: http://localhost:8000
# ---------- Docker ----------
docker-build:
name: Docker Build Test
runs-on: ubuntu-latest
needs: [backend-test, frontend-build]
steps:
- uses: actions/checkout@v4
- name: Build backend image
run: docker build -f infra/docker/Dockerfile.backend -t gps-backend:test .
- name: Build frontend image
run: docker build -f infra/docker/Dockerfile.frontend -t gps-frontend:test .