new domain holons.energy #1815
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 CI | |
on: | |
push: | |
branches: ["main", "acceptance", "production"] | |
pull_request: | |
branches: ["main", "acceptance", "production"] | |
defaults: | |
run: | |
working-directory: ./src | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
DB_USER: postgres | |
DB_PASSWORD: postgres | |
DB_HOST: localhost # default host value for the database | |
DB_NAME: djtesting | |
DB_PORT: 5432 | |
services: | |
postgres_main: | |
image: postgres:13.9 | |
env: | |
POSTGRES_USER: ${{ env.DB_USER }} | |
POSTGRES_PASSWORD: ${{ env.DB_PASSWORD }} | |
POSTGRES_DB: ${{ env.DB_NAME }} | |
ports: | |
- 5432:5432 | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
strategy: | |
max-parallel: 4 | |
matrix: | |
python-version: [3.11] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements/test.txt | |
cd holon/services | |
- name: Lint with Black | |
uses: psf/black@stable | |
with: | |
options: --check --line-length 100 --exclude "^.*\b(migrations)\b.*$" | |
version: "~= 24.4.2" | |
- name: Run Tests | |
run: | | |
python manage.py test | |
env: | |
ALLOWED_HOSTS: "*" | |
MEDIA_PATH: ./media/ | |
STATIC_PATH: ./static/ | |
DJANGO_SETTINGS_MODULE: pipit.settings.test | |
SECRET_KEY: some-test-key-not-good-for-prod |