84 lines (80 loc) · 2.58 KB
/
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
81
82
83
name: CI
on:
- push
- pull_request
jobs:
build:
name: build
runs-on: ubuntu-16.04
strategy:
matrix:
python-version:
- 3.6
# need sodar_core ugprade for support beyond 3.7 (celery dependency)
# - 3.7
# - 3.8
# - 3.9
services:
redis:
image: redis:latest
ports:
- 6379:6379
postgres:
image: postgres:12
env:
POSTGRES_DB: varfish_web
POSTGRES_USER: varfish_web
POSTGRES_PASSWORD: varfish_web
DATABASE_URL: postgres://varfish_web:varfish_web@postgres/varfish_web
CELERY_BROKER_URL: redis://redis:6379/0
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 10
ports:
- 5432:5432
env:
CELERY_BROKER_URL: redis://0.0.0.0:6379/0
DATABASE_URL: 'postgres://varfish_web:varfish_web@0.0.0.0/varfish_web'
POSTGRES_HOST: 0.0.0.0
POSTGRES_PORT: 5432
steps:
- name: install server dependencies
run: |
sudo apt-get install -qq build-essential zlib1g-dev libtiff5-dev libjpeg8-dev libfreetype6-dev
sudo apt-get install -qq liblcms2-dev libwebp-dev libpq-dev graphviz-dev
- name: install Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: checkout repository
uses: actions/checkout@v2
- name: install project Python dependencies
run: |
pip install wheel==0.34.2
pip install -r requirements/local.txt
pip install -r requirements/test.txt
pip install -U 'celery >4.2'
- name: make sure all npm stuff is there
run: |
npm ci --prefix varfish/vueapp
# Temporary HACK, should not actually do this
nohup npm run -prefix varfish/vueapp serve &
- name: run collectstatic
run: python manage.py collectstatic --noinput
- name: run tests
run: |
coverage run --rcfile=.coveragerc manage.py test -v 2 --settings=config.settings.test
coverage xml
coverage report
- name: check formatting
run: make black arg=--check
- name: Coveralls
uses: AndreMiras/coveralls-python-action@develop
- name: run Codacy coverage reporter
uses: codacy/codacy-coverage-reporter-action@master
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: coverage.xml
if: ${{ matrix.python-version == '3.7' }}