Skip to content

Merge pull request #62 from ens-lgil/main #46

Merge pull request #62 from ens-lgil/main

Merge pull request #62 from ens-lgil/main #46

Workflow file for this run

name: Django CI
on:
push:
branches: [ "main" ]
pull_request:
types: [opened, edited, reopened]
env:
DEBUG: False
IS_TEST: 'True'
PUBLIC_SITE: 'True'
ALLOWED_HOSTS: localhost
DATABASE_NAME: db_test
DATABASE_USER: postgres
DATABASE_PASSWORD: postgres
DATABASE_HOST: localhost
DATABASE_PORT: 5432
DATABASE_PORT_LOCAL: 5432
DATABASE_NAME_2: db_test_applications
DATABASE_USER_2: postgres
DATABASE_PASSWORD_2: postgres
DATABASE_HOST_2: localhost
DATABASE_PORT_2: 5432
DATABASE_PORT_LOCAL_2: 5432
DATABASE_NAME_3: db_test_plot
DATABASE_USER_3: postgres
DATABASE_PASSWORD_3: postgres
DATABASE_HOST_3: localhost
DATABASE_PORT_3: 5432
DATABASE_PORT_LOCAL_3: 5432
REST_URL_ROOT: http://127.0.0.1/rest/
ELASTICSEARCH_URL_ROOT: http://localhost:9200
SECRET_KEY: 1234
jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15
# Provide the user/password/db for postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: db_test
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
strategy:
max-parallel: 2
matrix:
python-version: [3.12]
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- 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.txt
pip install -r requirements_local.txt
# - name: Install Elasticsearch
# run: |
# curl https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.17.28-amd64.deb -o elasticsearch.deb
# sudo dpkg -i --force-confnew elasticsearch.deb
# sudo chown -R elasticsearch:elasticsearch /etc/default/elasticsearch
# sudo service elasticsearch start
- name: Run migrations
run: python manage.py migrate
- name: Run Tests
run: |
python manage.py test
python manage.py test imports/tests