tests integrated #43
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI Pipeline | |
on: | |
push: | |
branches: [main] | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Build & start services | |
run: | | |
docker-compose up --build -d | |
env: | |
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
- name: Wait for backend to be ready | |
run: | | |
# simple wait—adjust if you have a healthcheck endpoint | |
sleep 10 | |
- name: Run backend tests | |
# run pytest inside a one-off container, then tear it down | |
run: | | |
docker-compose run --rm backend pytest -q --disable-warnings --maxfail=1 | |
- name: Tear down | |
run: | | |
docker-compose down |