52 lines
1.0 KiB
YAML
52 lines
1.0 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
|
|
services:
|
|
sqlite:
|
|
image: alpine:latest
|
|
options: >-
|
|
--entrypoint /bin/sh
|
|
-c "echo 'Using in-memory SQLite for tests'"
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.11'
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
pip install -r requirements.txt
|
|
pip install pytest pytest-asyncio aiosqlite
|
|
|
|
- name: Run tests
|
|
run: pytest tests/ -v --tb=short
|
|
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
needs: test
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Build Docker image
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: ./claudia-docs-api
|
|
push: false
|
|
tags: claudia-docs-api:latest
|