test #2505
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: test | |
on: | |
push: | |
schedule: | |
- cron: "0 0 * * *" | |
jobs: | |
server: | |
env: | |
DJANGO_SUPERUSER_PASSWORD: django-password | |
DJANGO_SUPERUSER_USERNAME: admin | |
DJANGO_SUPERUSER_EMAIL: [email protected] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.8" | |
- name: Build images | |
run: docker-compose -f "docker-compose.yml" build | |
- name: Install Tox | |
run: | | |
docker-compose run --rm django pip install --upgrade pip | |
docker-compose run --rm django pip install tox | |
- name: Start services | |
run: docker-compose -f "docker-compose.yml" up -d | |
- uses: ifaxity/wait-on-action@v1 | |
with: | |
resource: 'tcp:localhost:5432 tcp:localhost:5672' | |
verbose: true | |
- name: Run tox | |
run: docker-compose run --rm django tox | |
env: | |
DJANGO_DATABASE_URL: postgres://postgres:postgres@localhost:5432/django | |
DJANGO_MINIO_STORAGE_ENDPOINT: localhost:9000 | |
DJANGO_MINIO_STORAGE_ACCESS_KEY: minioAccessKey | |
DJANGO_MINIO_STORAGE_SECRET_KEY: minioSecretKey | |
DJANGO_API_URL: http://localhost:8000/api/v1 | |
DJANGO_HOMEPAGE_REDIRECT_URL: http://localhost:8081 | |
client: | |
env: | |
DJANGO_SUPERUSER_PASSWORD: django-password | |
DJANGO_SUPERUSER_USERNAME: admin | |
DJANGO_SUPERUSER_EMAIL: [email protected] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.8" | |
- name: Install tox | |
run: | | |
pip install --upgrade pip | |
pip install tox | |
- name: Build images | |
run: docker-compose build | |
- name: Run migrations | |
run: docker-compose run --rm django ./manage.py migrate | |
- name: Create super user | |
run: docker-compose run -e DJANGO_SUPERUSER_PASSWORD=$DJANGO_SUPERUSER_PASSWORD --rm django ./manage.py createsuperuser --noinput --email=$DJANGO_SUPERUSER_EMAIL | |
- name: Start server | |
run: docker-compose up -d | |
- uses: ifaxity/wait-on-action@v1 | |
with: | |
resource: 'http://localhost:8000/api/docs/swagger/' | |
- name: Run tox | |
run: tox | |
working-directory: ./swcc | |
- name: Stop server | |
run: docker-compose down --volumes | |
if: ${{ always() }} |