Log des actions de modération #581
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: Dora Back CI | |
on: | |
push: | |
paths: | |
- 'back/**' | |
- '.github/workflows/**' | |
pull_request: | |
paths: | |
- 'back/**' | |
- '.github/workflows/**' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
DJANGO_SETTINGS_MODULE: config.settings.test | |
DJANGO_SECRET_KEY: foo | |
DATABASE_URL: postgresql://postgres@localhost:5432/dora | |
MINIO_SECRET_KEY: minio-secret-key | |
REDIS_URL: redis://localhost:6379 | |
AWS_S3_ENDPOINT_URL: http://localhost:9000 | |
AWS_SECRET_ACCESS_KEY: $MINIO_SECRET_KEY | |
REQUIREMENTS_PATH: requirements/test.txt # Pas besoin de préciser 'back' ici, car le 'working-directory' sera 'back' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }} | |
cancel-in-progress: true | |
services: | |
s3: | |
image: bitnami/minio:latest | |
env: | |
MINIO_SERVER_ACCESS_KEY: minio-access-key | |
MINIO_SERVER_SECRET_KEY: $MINIO_SECRET_KEY | |
ports: | |
- 9000:9000 | |
redis: | |
image: redis:alpine | |
ports: | |
- 6379:6379 | |
postgres: | |
image: postgis/postgis:14-3.4 | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_DB: postgres | |
POSTGRES_HOST_AUTH_METHOD: trust | |
ports: | |
- 5432:5432 | |
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
steps: | |
- name: Installation de GDAL et psql | |
run: sudo apt update && sudo apt install -y gdal-bin postgresql-client | |
- name: Checkout du projet | |
uses: actions/checkout@v4 | |
# On spécifie que toutes les étapes suivantes se feront dans le répertoire 'back' | |
- name: Création de la base de données | |
working-directory: back | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_DB: postgres | |
POSTGRES_HOST: localhost | |
run: | | |
psql -h $POSTGRES_HOST -U $POSTGRES_USER $POSTGRES_DB <<EOL | |
DROP DATABASE IF EXISTS dora; | |
CREATE DATABASE dora; | |
EOL | |
- name: Installation de Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
cache: pip | |
cache-dependency-path: back/$REQUIREMENTS_PATH | |
- name: Installation des dépendences | |
working-directory: back | |
run: pip install -r $REQUIREMENTS_PATH | |
- name: Vérification de la compilation des sources Python | |
working-directory: back | |
run: python -m compileall -q . | |
- name: Linting et formatage du code Python | |
working-directory: back | |
run: ruff check dora config | |
- name: Vérification Django (check et migrations) | |
working-directory: back | |
run: | | |
./manage.py check | |
./manage.py makemigrations --check --dry-run --noinput | |
- name: Vérification des fichiers SQL | |
working-directory: back | |
run: sqlfluff lint queries | |
- name: Vérification des fichier HTML et templates | |
working-directory: back | |
run: djhtml -t 2 -c dora | |
- name: Tests | |
working-directory: back | |
run: pytest |