forked from varfish-org/varfish-server
-
Notifications
You must be signed in to change notification settings - Fork 0
140 lines (135 loc) · 4.21 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
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
133
134
135
136
137
138
139
140
name: CI
on:
- push
- pull_request
jobs:
python-build:
name: python-build
runs-on: ubuntu-20.04
strategy:
matrix:
python-version:
- '3.8'
- '3.9'
- '3.10'
postgres-version:
- '12'
include:
- python-version: '3.8'
postgres-version: '11'
- python-version: '3.8'
postgres-version: '13'
- python-version: '3.8'
postgres-version: '14'
services:
redis:
image: redis:latest
ports:
- 6379:6379
postgres:
image: postgres:${{ matrix.postgres-version }}
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:[email protected]/varfish_web'
POSTGRES_HOST: 0.0.0.0
POSTGRES_PORT: 5432
steps:
- name: install server dependencies
run: |
sudo apt-get update
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.37.1
pip install -r requirements/local.txt
pip install -r requirements/test.txt
pip freeze
- name: Build and run Vue app
run: |
npm ci --prefix varfish/vueapp
npm run build --prefix varfish/vueapp
nohup npm run --prefix varfish/vueapp serve &
- name: download icons
run: python manage.py geticons
- 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: Download codecov binary
run: |
curl -s https://uploader.codecov.io/latest/linux/codecov > /tmp/codecov
chmod +x /tmp/codecov
if: ${{ matrix.python-version == '3.8' }}
- name: Run Codecov for Python
run: |
/tmp/codecov -cF python
if: ${{ matrix.python-version == '3.8' }}
python-lint:
name: python-lint
runs-on: ubuntu-20.04
steps:
- name: install Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: checkout repository
uses: actions/checkout@v2
- name: install project Python dependencies
run: |
pip install wheel==0.37.1
pip install -r requirements/local.txt
pip install -r requirements/test.txt
pip freeze
- name: Check import order with isort
run: |
rm -rf src
isort --force-sort-within-sections --profile=black --check .
- name: Check style with black
run: black --check --line-length 100 .
- name: Run linting
run: flake8
nodejs:
runs-on: ubuntu-latest
steps:
- name: checkout repository
uses: actions/checkout@v2
- name: Download codecov binary
run: |
curl -s https://uploader.codecov.io/latest/linux/codecov > /tmp/codecov
chmod +x /tmp/codecov
- name: Install javascript dependencies
run: |
npm ci --prefix varfish/vueapp
- name: Run Vue app tests
run: |
make vue_test-coverage
- name: Run Codecov for Javascript
run: |
/tmp/codecov -cF javascript
- name: Lint Vue app
run: make vue_lint