Case amb #9452
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: Py Django testing | |
on: | |
push: | |
branches: [ develop ] | |
paths: | |
- '**.py' | |
- 'pyproject.toml' | |
- 'poetry.lock' | |
- '.github/workflows/python-app.yml' | |
pull_request: | |
branches: [ develop ] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:14 | |
env: | |
POSTGRES_DB: l2 | |
POSTGRES_PASSWORD: 123456 | |
POSTGRES_USER: postgres | |
ports: ['5432:5432'] | |
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
steps: | |
- uses: actions/checkout@v3 | |
- run: sudo apt install libmupdf-dev | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install poetry | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
- run: poetry install | |
- name: Migrate | |
run: | | |
source .venv/bin/activate | |
python3 manage.py migrate | |
- name: Make migrations | |
run: | | |
source .venv/bin/activate | |
python3 manage.py makemigrations | |
- name: Migrate | |
run: | | |
source .venv/bin/activate | |
python3 manage.py migrate | |
- name: Run Tests | |
run: | | |
source .venv/bin/activate | |
python3 manage.py test |