Fastapi based API #325
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: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- "*" | |
jobs: | |
Tests: | |
name: ${{ matrix.os }} / ${{ matrix.python-version }} | |
runs-on: ${{ matrix.os }}-latest | |
strategy: | |
matrix: | |
os: [Ubuntu] | |
python-version: [3.8, 3.9, "3.10"] # python 3.7 temporarily disabled due to lack of altair | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Get full Python version | |
id: full-python-version | |
run: | | |
echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))") | |
- name: Install poetry | |
run: | | |
curl -fsS https://install.python-poetry.org | python - --preview -y | |
- name: Add poetry to PATH | |
run: echo "$HOME/.local/bin" >> $GITHUB_PATH | |
- name: Set up poetry cache | |
uses: actions/cache@v3 | |
with: | |
path: "$HOME/.cache/pypoetry/virtualenvs" | |
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }} | |
- name: Set up datadir cache | |
uses: actions/cache@v3 | |
with: | |
path: tests/data/datadir/ | |
key: tests-data-datadir | |
- name: Set up measurements cache | |
uses: actions/cache@v3 | |
with: | |
path: tests/data/measurements/ | |
key: tests-data-measurements-${{ hashFiles('tests/_sample_measurements.py') }} | |
- name: Set up raw_measurements cache | |
uses: actions/cache@v3 | |
with: | |
path: tests/data/measurements/ | |
key: tests-data-raw_measurements-${{ hashFiles('tests/conftest.py') }} | |
- name: Install clickhouse | |
run: | | |
sudo apt-get install -y apt-transport-https ca-certificates dirmngr | |
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 8919F6BD2B48D754 | |
echo "deb https://packages.clickhouse.com/deb stable main" | sudo tee \ | |
/etc/apt/sources.list.d/clickhouse.list | |
sudo apt-get update | |
sudo apt-get install -y clickhouse-server clickhouse-client | |
- name: start clickhouse | |
run: sudo service clickhouse-server start | |
- name: Install dependencies | |
run: poetry install | |
- name: Run all tests | |
env: | |
PYTHONUNBUFFERED: "1" | |
run: poetry run pytest -s --full-trace --log-level=INFO --log-cli-level=INFO -v --setup-show --cov=./ --cov-report=xml --cov-report=term tests | |
- name: Upload coverage to codecov | |
uses: codecov/codecov-action@v3 |