forked from PGScatalog/PGS_Catalog
-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (70 loc) · 2.2 KB
/
django_ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
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