-
Notifications
You must be signed in to change notification settings - Fork 45
227 lines (196 loc) · 7.49 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
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
name: Tests
on:
push:
branches:
- develop
pull_request:
branches:
- develop
jobs:
js-unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
- name: Setup and run tests
working-directory: ./src
run: |
npm ci
npm install grunt-cli -g
grunt ci
- name: Coveralls Parallel
uses: coverallsapp/github-action@release/v2
with:
github-token: ${{ secrets.github_token }}
flag-name: browsers
base-path: src
path-to-lcov: src/build/coverage/lcov.info
parallel: true
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Build
working-directory: ./src
run: ./setup.py bdist_wheel
- name: Upload build wheel
uses: actions/upload-artifact@v4
with:
name: wheel
path: src/dist/*.whl
django-unit-tests:
runs-on: ubuntu-latest
strategy:
matrix:
django-version:
- "2.0"
- "2.1"
- "2.2"
python-version:
#- "3.6"
- "3.7"
- "3.8"
- "3.9"
- "3.10"
steps:
- name: Setup PostgreSQL
run: |
docker run --rm -e POSTGRES_DB=postgres -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=wirecloud -d -p 5432:5432 --name postgres-wirecloud postgres:latest
- uses: actions/checkout@v4
- name: Use Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Setup and run tests
working-directory: ./src
env:
DJANGO_VERSION: ${{ matrix.django-version }}
run: |
pip install "Django>=${DJANGO_VERSION},<${DJANGO_VERSION%.*}.$((${DJANGO_VERSION#*.} + 1))"
pip install "psycopg2-binary<2.9"
pip install -r requirements.txt
pip install -r requirements-dev.txt
python manage.py collectstatic -v 0 -c --noinput
coverage run -a --branch --source wirecloud --omit="*/wirecloud/semanticwiring/*,*/wirecloud/guidebuilder/*,*/tests/*,*/tests.py,*/wirecloud/commons/utils/remote.py" manage.py test --noinput --nologcapture -v 2 -a tags='wirecloud-noselenium'
- name: Coveralls Parallel
uses: AndreMiras/coveralls-python-action@develop
with:
github-token: ${{ secrets.github_token }}
flag-name: django-unit-tests-python${{ matrix.python-version }}-django${{ matrix.django-version }}
base-path: src
parallel: true
django-search-indexes-tests:
runs-on: ubuntu-latest
strategy:
matrix:
engine:
- "Elasticsearch"
- "Solr"
steps:
- name: Setup PostgreSQL
run: |
docker run --rm -e POSTGRES_DB=postgres -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=wirecloud -d -p 5432:5432 --name postgres-wirecloud postgres:latest
- uses: actions/checkout@v4
- name: Use Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Use Elasticsearch
working-directory: ./src
run: |
docker run -p 9200:9200 --rm -d --name elasticsearch-wirecloud elasticsearch:2.4
if: ${{ matrix.engine == 'Elasticsearch' }}
- name: Use Solr
working-directory: ./src
run: |
docker run -p 8983:8983 --rm --name solr-wirecloud -d solr:6
if: ${{ matrix.engine == 'Solr' }}
- name: Setup and run tests
working-directory: ./src
run: |
pip install "Django>=2.2,<2.3"
pip install "psycopg2-binary<2.9"
pip install -r requirements.txt
pip install -r requirements-dev.txt
cp ci_scripts/base_settings.py settings.py
if [ "${{ matrix.engine }}" == "Elasticsearch" ]; then
pip install elasticsearch==2.4.1
cat ci_scripts/templates/elasticsearch-conf.template >> settings.py
else
pip install pysolr
cat ci_scripts/templates/solr-conf.template >> settings.py
mkdir solr_conf
python manage.py build_solr_schema --configure-directory solr_conf
docker exec --user=solr solr-wirecloud bin/solr create -c tester -n basic_config
docker exec solr-wirecloud rm -f /opt/solr/server/solr/tester/conf/managed-schema.xml
docker cp solr_conf/schema.xml solr-wirecloud:/opt/solr/server/solr/tester/conf/
docker cp solr_conf/solrconfig.xml solr-wirecloud:/opt/solr/server/solr/tester/conf/
# Reload the Solr core
curl "http://localhost:8983/solr/admin/cores?action=RELOAD&core=tester"
fi
python manage.py collectstatic -v 0 -c --noinput
coverage run -a --branch --source wirecloud --omit="*/wirecloud/semanticwiring/*,*/wirecloud/guidebuilder/*,*/tests/*,*/tests.py,*/wirecloud/commons/utils/template/*" manage.py test --noinput --nologcapture -v 2 -a tags='wirecloud-search-api'
- name: Coveralls Parallel
uses: AndreMiras/coveralls-python-action@develop
with:
github-token: ${{ secrets.github_token }}
flag-name: django-search-indexes-tests-${{ matrix.engine }}
base-path: src
parallel: true
django-selenium-tests:
runs-on: ubuntu-latest
steps:
- name: Setup PostgreSQL
run: |
docker run --rm -e POSTGRES_DB=postgres -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=wirecloud -d -p 5432:5432 --name postgres-wirecloud postgres:latest
- name: Use Geckodriver
uses: browser-actions/setup-geckodriver@latest
- uses: actions/checkout@v4
- name: Use Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Use Elasticsearch
working-directory: ./src
run: |
docker run -p 9200:9200 --rm -d --name elasticsearch-wirecloud elasticsearch:2.4
- name: Setup and run tests
working-directory: ./src
env:
MOZ_HEADLESS: 1
run: |
pip install "Django>=2.2,<2.3"
pip install "psycopg2-binary<2.9"
pip install -r requirements.txt
pip install -r requirements-dev.txt
cp ci_scripts/base_settings.py settings.py
pip install elasticsearch==2.4.1
cat ci_scripts/templates/elasticsearch-conf.template >> settings.py
python manage.py collectstatic -v 0 -c --noinput
coverage run -a --branch --source wirecloud --omit="*/wirecloud/semanticwiring/*,*/wirecloud/guidebuilder/*,*/tests/*,*/tests.py,*/wirecloud/commons/utils/template/*" manage.py test --noinput --nologcapture -v 2 -a tags='wirecloud-selenium'
- name: Coveralls Parallel
uses: AndreMiras/coveralls-python-action@develop
with:
github-token: ${{ secrets.github_token }}
flag-name: django-selenium-tests
base-path: src
parallel: true
finish:
needs:
- django-unit-tests
- django-search-indexes-tests
- django-selenium-tests
- js-unit-tests
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true