test(ci): trigger automated test workflow #7
Workflow file for this run
This file contains 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: Backend Tests | |
on: | |
pull_request: | |
paths: | |
- "backend/**" | |
branches: | |
- main | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Build the Docker image | |
run: docker build -t backend-app ./backend | |
- name: Run the Container | |
run: docker run -d -p 8000:8000 --name backend-container backend-app | |
- name: Wait for API to be Ready | |
run: | | |
echo "Waiting for API..." | |
for i in {1..30}; do | |
curl --silent --fail http://localhost:8000/health && break | |
sleep 2 | |
done | |
echo "API is ready!" | |
- name: Run Tests with pytest | |
run: | | |
docker exec backend-container poetry run pytest --maxfail=3 --disable-warnings -v |