Files
full-stack-fastapi-template/.github/workflows/test.yaml
Esteban Maya f41f4432fe ♻ Refactor items and services endpoints to return count and data, and add CI tests (#599)
Co-authored-by: Esteban Maya Cadavid <emaya@trueblue.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2024-02-25 16:04:47 +01:00

38 lines
853 B
YAML

name: Test
on:
push:
branches:
- master
pull_request:
types:
- opened
- synchronize
jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: src
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Docker Compose build
run: docker compose build
- name: Docker Compose remove old containers and volumes
run: docker compose down -v --remove-orphans
- name: Docker Compose up
run: docker compose up -d
- name: Docker Compose run tests
run: docker compose exec -T backend bash /app/tests-start.sh
- name: Docker Compose cleanup
run: docker compose down -v --remove-orphans