Skip to content

Merge pull request #363 from ens-lgil/feature/rest_api_hide_validator… #166

Merge pull request #363 from ens-lgil/feature/rest_api_hide_validator…

Merge pull request #363 from ens-lgil/feature/rest_api_hide_validator… #166

Workflow file for this run

name: Django CI
on:
push:
branches:
- master
pull_request:
types: [opened, edited, reopened]
env:
DEBUG: False
ALLOWED_HOSTS: 'localhost'
PGS_LIVE_SITE: 'False'
PGS_CURATION_SITE: 'True'
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_benchmark'
DATABASE_USER_2: 'postgres'
DATABASE_PASSWORD_2: 'postgres'
DATABASE_HOST_2: 'localhost'
DATABASE_PORT_2: 5432
DATABASE_PORT_LOCAL_2: 5432
DATABASE_NAME_TRACKER: 'db_test_curation_tracker'
DATABASE_USER_TRACKER: 'postgres'
DATABASE_PASSWORD_TRACKER: 'postgres'
DATABASE_HOST_TRACKER: 'localhost'
DATABASE_PORT_TRACKER: 5432
DATABASE_PORT_LOCAL_TRACKER: 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:12
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: db_test
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@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.11"
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements_local.txt
pip install requests
pip install xlrd openpyxl numpy
- name: Install Elasticsearch
run: |
curl https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.15.0-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 catalog/tests curation/tests rest_api/tests