Skip to content

Drop Python to 3.10 #190

Drop Python to 3.10

Drop Python to 3.10 #190

Workflow file for this run

---
name: CI
"on":
push:
branches:
- master
- devel
pull_request:
env:
# Python 3.12 doesn't work
# since setuptools is no longer installed in venvs.
# Need to wait for Nornir to add it as an explicit dependency.
PYTHON_VERSION: "3.10"
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Load cached venv
id: cache-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }}
- name: Run poetry install
run: poetry install
if: steps.cache-poetry-dependencies.outputs.cache-hit != 'true'
- name: Build docs
working-directory: ./docs
run: poetry run make html SPHINXOPTS="-n"
test:
strategy:
matrix:
ros_version:
- 7.10.1
# Long-term
- 6.48.6
runs-on: ubuntu-latest
services:
routeros:
image: ghcr.io/devon-mar/docker-routeros:${{ matrix.ros_version }}
ports:
- 2222:22
- 8728:8728
- 8729:8729
volumes:
- /dev/net/tun:/dev/net/tun
options: >-
--cap-add=NET_ADMIN
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
# https://stackoverflow.com/questions/62977821/how-to-cache-poetry-install-for-github-actions
- name: Load cached venv
id: cache-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }}
- name: Run poetry install
run: poetry install
if: steps.cache-poetry-dependencies.outputs.cache-hit != 'true'
- name: Setup the router
run: tests/ros_setup.sh
- name: Run pytest
run: |
poetry run pytest -vv --cov=./nornir_routeros --cov-report=xml --cov-branch
- name: Upload coverage to codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}