display ENV banner anywhere except in PROD #3140
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: 🔮 CI | |
on: [push] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
PYTHONPATH: . | |
DJANGO_SETTINGS_MODULE: config.settings.test | |
CPUCOUNT: 1 | |
PGPASSWORD: password | |
PGHOST: localhost | |
PGUSER: postgres | |
services: | |
minio: | |
image: bitnami/minio | |
env: | |
MINIO_ROOT_USER: minioadmin | |
MINIO_ROOT_PASSWORD: minioadmin | |
ports: | |
- 9000:9000 | |
postgres: | |
# Docker Hub image | |
image: postgres:15-alpine | |
env: | |
POSTGRES_PASSWORD: password | |
ports: | |
- 5432:5432 | |
# Set health checks to wait until postgres has started | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: 💾 Create a database to check migrations | |
run: | | |
psql <<SQL | |
CREATE DATABASE communaute; | |
SQL | |
- name: 💂 Install uv | |
uses: astral-sh/setup-uv@v5 | |
- name: 💂 Set up Python | |
run: uv python install | |
- name: 💂 Install the project | |
run: uv sync --dev | |
# export venv path to $GITHUB_ENV to make it avail at each step | |
- name: Activate virtualenv | |
run: | | |
source .venv/bin/activate | |
echo PATH=$PATH >> $GITHUB_ENV | |
- name: ✨ Ruff & djlint | |
run: make quality | |
- name: 🚧 create cache table | |
run: python manage.py createcachetable | |
- name: 🚧 collect static for testing purposes | |
run: | | |
python manage.py collectstatic --no-input | |
python manage.py compress | |
- name: 🚧 compile translations | |
run: | | |
sudo apt-get install -y gettext | |
python manage.py compilemessages | |
- name: 🚧 Check pending migrations | |
run: python manage.py makemigrations --check --dry-run --noinput | |
- name: 🚧 Configure bucket | |
run: python manage.py configure_bucket | |
- name: 🤹 Django tests | |
run: pytest --numprocesses=logical --create-db | |
env: | |
DJANGO_DEBUG: True |