forked from HumanSignal/label-studio
-
Notifications
You must be signed in to change notification settings - Fork 0
132 lines (114 loc) · 3.68 KB
/
tests.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: pytest:ubnt
on:
push:
branches: ['*', '*/*', master]
paths:
- 'label_studio/**'
jobs:
run_pytest_sqlite:
name: LS SQLite
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
env:
DJANGO_SETTINGS_MODULE: core.settings.label_studio
LOG_DIR: pytest_logs
collect_analytics: false
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
pip install --upgrade cython
sh ./deploy/install_npm.sh
pip install -U pip==20.2
pip install -r deploy/requirements.txt -r deploy/requirements-test.txt
pip install -e .
- name: Install LSF & set version.py
run: ./deploy/prebuild.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Do migrations
run: python label_studio/manage.py migrate
- name: Run functional tests
run: |
cd label_studio/
pytest --junitxml report.xml --cov=. -m "not integration_tests"
- name: Comment coverage
uses: coroo/[email protected]
- name: Publish Unit Test Results
uses: EnricoMi/[email protected]
if: always()
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
files: label_studio/report.xml
run_pytest_postgresql:
name: LS PostgreSQL
runs-on: ubuntu-latest
env:
DJANGO_SETTINGS_MODULE: core.settings.pytest
LOG_DIR: pytest_logs
collect_analytics: false
# Service containers to run with `container-job`
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres:11.5
# Provide the password for postgres
env:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_DB: postgres
# 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
# Label used to access the service container
redis:
# Docker Hub image
image: redis
# Set health checks to wait until redis has started
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps port 6379 on service container to the host
- 6379:6379
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.7'
- name: Install dependencies
run: |
sudo apt-get clean
sudo apt-get update
sudo apt-get install virtualenv libsasl2-dev python-dev libldap2-dev libssl-dev
sh ./deploy/install_npm.sh
pip install -U pip==20.2
pip install -r deploy/requirements.txt -r deploy/requirements-test.txt
pip install -e .
- name: Install LSF & set version.py
run: ./deploy/prebuild.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Do migrations
run: python label_studio/manage.py migrate
- name: Run functional tests
run: |
cd label_studio/
pytest -m "not integration_tests"