Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/api-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: API - Build & Test

on:
pull_request:
branches: [ main ]
push:
branches: [ main ]

jobs:
build-and-test:
runs-on: ubuntu-latest

services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_USER: user
POSTGRES_PASSWORD: password
POSTGRES_DB: chatops_test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432

env:
DATABASE_URL: postgresql://user:password@localhost:5432/chatops_test
SECRET_KEY: test-secret-key-for-ci
CORS_ORIGINS: '["http://localhost:5173", "http://localhost:3000"]'

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: '3.12'
cache: 'pip'
cache-dependency-path: 'api/requirements.txt'

- name: Install dependencies
working-directory: ./api
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

Comment thread
martian56 marked this conversation as resolved.
- name: Run tests
working-directory: ./api
run: pytest -v