-
Notifications
You must be signed in to change notification settings - Fork 11
175 lines (145 loc) · 4.48 KB
/
main.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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
name: CI
on:
- push
- pull_request
jobs:
Python-Test:
runs-on: ubuntu-latest
services:
redis:
image: redis:latest
ports:
- 6379:6379
postgres:
image: postgres:14
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 system dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential zlib1g-dev libtiff5-dev libjpeg8-dev \
libfreetype6-dev liblcms2-dev libwebp-dev libpq-dev graphviz-dev \
libldap2-dev libsasl2-dev
- name: Checkout repository
uses: actions/checkout@v3
with:
lfs: true
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install pip and Pipenv
run: |
pip install -U pip pipenv
- name: Install project dependencies with pipenv
run: |
pipenv install --verbose --categories=packages,dev-packages,ldap-packages
- name: Download icons
run: pipenv run python manage.py geticons
- name: Run collectstatic
run: pipenv run python manage.py collectstatic --noinput
- name: Build Vue app as that can be tested via selenium.
run: |
npm ci --prefix varfish/vueapp
npm run build --prefix varfish/vueapp
nohup npm run serve --prefix varfish/vueapp &
- name: Setup environment with worker
uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment.yaml
init-shell: bash
cache-environment: true
post-cleanup: 'all'
- name: Run tests
run: |
pipenv run coverage run --rcfile=.coveragerc manage.py test -v 2 --settings=config.settings.test
pipenv run coverage xml
pipenv run coverage report
# Important: use shell that was initialized by micromamba.
shell: bash -el {0}
- name: Upload Python coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
flags: python
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
Python-Lint:
runs-on: ubuntu-20.04
steps:
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Checkout repository
uses: actions/checkout@v3
with:
lfs: true
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install pip and Pipenv
run: |
pip install pip pipenv
- name: Install project dependencies with pipenv
run: |
pipenv install --categories=packages,dev-packages
- name: Check import order with isort
run: |
rm -rf src
pipenv run isort --force-sort-within-sections --profile=black --check .
- name: Check style with black
run: |
pipenv run black --check --line-length 100 .
- name: Run linting
run: |
pipenv run flake8
Node-Lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
lfs: true
- name: Install javascript dependencies
run: |
npm ci --prefix varfish/vueapp
- name: Run linting
run: |
make vue_lint
Node-Test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
lfs: true
- name: Install javascript dependencies
run: |
npm ci --prefix varfish/vueapp
- name: Run Vue app tests
run: |
make vue_test-coverage
- name: Upload nodejs coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
flags: nodejs
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}