-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (45 loc) · 1.36 KB
/
pr-test.yaml
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
name: Pull request unit tests
on:
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ 3.8, 3.9]
services:
solr:
image: solr:8
options: --name my_solr
ports:
- 8983:8983
steps:
- uses: actions/checkout@v2
- name: Sleep for 15 seconds to give Solr time to start
run: sleep 15s
shell: bash
- name: Confirm that Solr is answering
run: curl -s -o /dev/null -w "%{http_code}" http://localhost:8983/solr/ || exit 1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/[email protected]
with:
virtualenvs-create: true
virtualenvs-in-project: true
# load cached venv if cache exists
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v2
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
run: poetry install --no-interaction
- name: add test solr core explicitly
run: poetry run lsolr add-cores test
- name: run tests
run: poetry run python -m unittest -v