Tests #623
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | |
- name: Install package | |
run: | | |
python -m venv venv | |
./venv/bin/pip install -e .[dev] | |
- name: Insert test data | |
run: ./venv/bin/python tests/data/insert.py | |
- name: Run tests | |
run: ./venv/bin/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" | |
- name: Install package | |
run: | | |
python -m venv venv | |
./venv/bin/pip install -e .[dev] | |
- name: Build documentation | |
run: ./venv/bin/mkdocs build --strict | |
- name: Publish documentation | |
run: ./venv/bin/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] | |
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 |