-
Notifications
You must be signed in to change notification settings - Fork 3
75 lines (71 loc) · 2.17 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
name: Tests
on: [push]
jobs:
test:
runs-on: ubuntu-latest
services:
clickhouse:
image: clickhouse/clickhouse-server
ports: ["8123:8123"]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.x"
- uses: dioptra-io/setup-poetry-action@v1
- name: Install package
run: poetry install
- name: Insert test data
run: poetry run tests/data/insert.py
- name: Run tests
run: poetry run pytest --cov=diamond_miner --cov-report=xml
- uses: codecov/codecov-action@v3
mkdocs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.x"
- uses: dioptra-io/setup-poetry-action@v1
- name: Install package
run: poetry install
- name: Build documentation
run: poetry run mkdocs build --strict
- name: Publish documentation
run: poetry run mkdocs gh-deploy --force --no-history --strict
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
pypi:
needs: [test]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v2
with:
platforms: all
- name: Build wheels
uses: pypa/[email protected]
env:
# Ideally we'd specify this in the [project] section of pyproject.toml,
# but this causes issues with poetry.
# See https://cibuildwheel.readthedocs.io/en/stable/options/#requires-python
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.10"
with:
output-dir: dist
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
path: dist/*.whl
- uses: dioptra-io/publish-python-action@v1
with:
password: ${{ secrets.PYPI_TOKEN }}
upload: ${{ startsWith(github.ref, 'refs/tags/v') }}
wheel: false