Merge branch 'master' into 95-migrate-to-sqlalchemy-20-api #331
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: Mesh Info Tests | |
on: [push] | |
jobs: | |
pre-commit: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pre-commit | |
- name: Run pre-commit | |
run: pre-commit run --all-files | |
tests: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: | |
- "3.9" | |
- "3.10" | |
- "3.11" | |
services: | |
postgres: | |
image: postgres | |
env: | |
POSTGRES_PASSWORD: meshmap | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 5432:5432 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Cache pip | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y librrd-dev | |
python -m pip install --upgrade pip wheel | |
pip install -r requirements.txt -e .[tests] | |
- name: Run flake8 | |
run: flake8 meshinfo tests | |
- name: Run mypy | |
run: mypy meshinfo tests | |
- name: Run pytest | |
run: pytest --cov=meshinfo | |
env: | |
MESHMAP_COLLECTOR_DATA_DIR: "." | |
POSTGRES_HOST: localhost | |
POSTGRES_PASSWORD: meshmap | |
docs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y librrd-dev | |
python -m pip install --upgrade pip wheel | |
pip install -r requirements.txt -e .[docs] | |
- name: Run Sphinx | |
run: sphinx-build -W --keep-going -b html docs docs/_build/html |