test_user_crud #issue 622 #61
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: Margin Tests | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'margin_app/**' | |
pull_request: | |
branches: | |
- main | |
paths: | |
- 'margin_app/**' | |
jobs: | |
shared: | |
uses: ./.github/workflows/shared_workflow.yml | |
with: | |
python-version: "3.12" | |
margin-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Create .env file | |
run: cp margin_app/.env.dev margin_app/.env | |
- name: Build and Start Containers | |
run: | | |
docker compose -f margin_app/docker-compose.yml --env-file margin_app/.env up -d --build | |
echo "Waiting for containers to be ready..." | |
sleep 30 | |
- name: Run Integration Tests with Coverage | |
run: | | |
docker compose -f margin_app/docker-compose.yml exec backend python -m pytest app/tests -v | |
- name: Clean Up | |
if: always() | |
run: | | |
docker compose -f margin_app/docker-compose.yml logs > docker-logs.txt || true | |
docker compose -f margin_app/docker-compose.yml down -v | |
- name: Upload Docker Logs on Failure | |
if: failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: docker-logs | |
path: docker-logs.txt |