-
Notifications
You must be signed in to change notification settings - Fork 11
106 lines (102 loc) · 3.23 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
name: CI
on:
- push
- pull_request
jobs:
build:
name: 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: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 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
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: Coveralls
uses: AndreMiras/coveralls-python-action@develop
with:
parallel: true
flag-name: Unit Test
- name: run Codacy coverage reporter
uses: codacy/codacy-coverage-reporter-action@master
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: coverage.xml
env:
secrets.CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
if: "${{ (matrix.python-version == '3.8') && (matrix.postgres-version == '12') && (!!env.CODACY_PROJECT_TOKEN) }}"
coveralls_finish:
needs: build
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: AndreMiras/coveralls-python-action@develop
with:
parallel-finished: true