From f4d1e15fa69aa317682725f9e83d755ae1c6792d Mon Sep 17 00:00:00 2001 From: Fusion Date: Thu, 14 May 2026 07:01:46 +0200 Subject: [PATCH] =?UTF-8?q?feat(FN-049):=20complete=20Step=201=20=E2=80=94?= =?UTF-8?q?=20create=20CI=20workflow=20and=20add=20pytest-asyncio=20depend?= =?UTF-8?q?ency?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fusion-Task-Id: FN-049 Fusion-Task-Lineage: c0c0a1bd-b925-4d84-b529-c9f9d6dde07a --- .github/workflows/ci.yml | 87 ++++++++++++++++++++++++++++++++++++++++ apps/api/pyproject.toml | 1 + 2 files changed, 88 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..543516f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,87 @@ +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 diff --git a/apps/api/pyproject.toml b/apps/api/pyproject.toml index 1dc9631..29885ec 100644 --- a/apps/api/pyproject.toml +++ b/apps/api/pyproject.toml @@ -18,6 +18,7 @@ dependencies = [ [project.optional-dependencies] dev = [ "pytest>=8.3.0", + "pytest-asyncio>=0.24.0", "httpx>=0.28.0", "ruff>=0.11.0", "mypy>=1.15.0",