f4d1e15fa6
Fusion-Task-Id: FN-049 Fusion-Task-Lineage: c0c0a1bd-b925-4d84-b529-c9f9d6dde07a
88 lines
1.9 KiB
YAML
88 lines
1.9 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
web-ci:
|
|
name: Web CI
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
|
|
- name: Setup pnpm
|
|
uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 9
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Lint
|
|
run: pnpm --filter @headquarter/web lint
|
|
|
|
- name: Typecheck
|
|
run: pnpm --filter @headquarter/web typecheck
|
|
|
|
- name: Test
|
|
run: pnpm --filter @headquarter/web test
|
|
|
|
api-ci:
|
|
name: API CI
|
|
runs-on: ubuntu-latest
|
|
services:
|
|
postgres:
|
|
image: postgres:16
|
|
env:
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: postgres
|
|
POSTGRES_DB: headquarter_test
|
|
options: >-
|
|
--health-cmd pg_isready
|
|
--health-interval 10s
|
|
--health-timeout 5s
|
|
--health-retries 5
|
|
ports:
|
|
- 5432:5432
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.11"
|
|
|
|
- name: Install API dev dependencies
|
|
working-directory: apps/api
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -e ".[dev]"
|
|
|
|
- name: Ruff check
|
|
working-directory: apps/api
|
|
run: ruff check app/ tests/
|
|
|
|
- name: Mypy
|
|
working-directory: apps/api
|
|
run: mypy app/ tests/
|
|
|
|
- name: Pytest
|
|
working-directory: apps/api
|
|
env:
|
|
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/headquarter_test
|
|
run: pytest
|