fix: attempt 2 to add multiple files support #37
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: Tests | |
on: [push, workflow_dispatch] | |
jobs: | |
run_tests: | |
name: Run tests | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Build docker images | |
run: docker compose -p test_sport -f compose/docker-compose-test.yml build --no-cache | |
- name: Run app in docker | |
run: docker compose -p test_sport -f compose/docker-compose-test.yml up -d | |
- name: Wait for database startup | |
run: docker compose -p test_sport -f compose/docker-compose-test.yml exec -T adminpanel bash -c "while !</dev/tcp/db/5432; do sleep 1; done;" | |
timeout-minutes: 1 | |
- name: Migrate database | |
run: | | |
docker compose -p test_sport -f compose/docker-compose-test.yml exec -T adminpanel python manage.py makemigrations | |
docker compose -p test_sport -f compose/docker-compose-test.yml exec -T adminpanel python manage.py migrate auth | |
docker compose -p test_sport -f compose/docker-compose-test.yml exec -T adminpanel python manage.py migrate | |
- name: Run tests | |
run: docker compose -p test_sport -f compose/docker-compose-test.yml exec -T adminpanel pytest | |
# cleanup: | |
# name: Cleanup test containers | |
# if: always() | |
# needs: run_tests | |
# runs-on: self-hosted | |
# steps: | |
# - name: Remove docker containers | |
# run: docker-compose -p test_sport -f compose/docker-compose-test.yml down --volumes --rmi all |