Ajout d'une configuration pour la CI #7
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: Django application | |
on: [push] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:latest | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DB: github_actions | |
ports: | |
- 5432:5432 | |
# needed because the postgres container does not provide a healthcheck | |
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11.1 | |
- name: Install dependencies | |
run: pip install pip-tools && pip-sync && playwright install | |
- name: Run ruff | |
run: ruff check . | |
- name: Run DjHTML | |
run: find -name *.html -not -path "./venv/*" | xargs djhtml | |
- name: Run tests | |
run: pytest | |
env: | |
SECRET_KEY: NOT_A_REAL_SECRET | |
DATABASE_URL: postgres://postgres:postgres@localhost/github_actions |