-
Notifications
You must be signed in to change notification settings - Fork 69
98 lines (83 loc) · 2.34 KB
/
run_tests.yml
File metadata and controls
98 lines (83 loc) · 2.34 KB
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
name: run_share_tests
on:
push:
pull_request:
workflow_dispatch:
permissions:
checks: write # for coveralls
jobs:
lint_and_type:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- name: setup python
uses: actions/setup-python@v5
with:
python-version: '3.13'
cache: 'poetry'
- name: install despondencies
run: poetry install --with dev
- name: flake it
run: poetry run flake8 .
- name: type-check
run: poetry run mypy trove
run_tests:
strategy:
fail-fast: false
matrix:
python-version: ['3.13']
postgres-version: ['17']
runs-on: ubuntu-latest
services:
postgres:
image: postgres:${{ matrix.postgres-version }}
env:
POSTGRES_PASSWORD: postgres
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
elasticsearch8:
image: elasticsearch:8.18.1
env:
xpack.security.enabled: false
node.name: singlenode
cluster.initial_master_nodes: singlenode
ports:
- 9208:9200
rabbitmq:
image: rabbitmq:management
ports:
- 5672:5672
- 15672:15672
steps:
- uses: actions/checkout@v4
- name: install non-py dependencies
run: sudo apt-get update && sudo apt-get install -y libxml2-dev libxslt1-dev libpq-dev git gcc
- name: Install poetry
run: pipx install poetry
- name: setup python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'
- name: install despondencies
run: poetry install --with dev
- name: run tests
run: |
poetry run coverage run -m pytest --create-db -x
poetry run coverage xml -o _shtrove_coverage.xml
env:
DATABASE_PASSWORD: postgres
ELASTICSEARCH8_URL: http://localhost:9208/
- name: coveralls
uses: coverallsapp/github-action@v2
with:
file: _shtrove_coverage.xml
fail-on-error: false