Compare commits

4 Commits
Author SHA1 Message Date
christianmanivong 5742349742 Merge pull request 'ci: run the tests and build the package on every push and pull request' (#2) from ci/workflow into master
CI / test (3.10) (push) Successful in 29s
CI / test (3.11) (push) Successful in 27s
CI / test (3.12) (push) Successful in 29s
2026-10-07 06:29:44 +00:00
Christian Manivong ca03b6dd99 ci: run the tests and build the package on every push and pull request
CI / test (3.10) (push) Successful in 28s
CI / test (3.11) (push) Successful in 27s
CI / test (3.12) (push) Successful in 29s
CI / test (3.10) (pull_request) Successful in 28s
CI / test (3.11) (pull_request) Successful in 27s
CI / test (3.12) (pull_request) Successful in 29s
The same job as napalm-fritzbox and napalm-opnsense: Python 3.10, 3.11 and
3.12, pytest, then wheel and sdist. napalm-device-types comes from
git.netork.io first, because PyPI has an unrelated package of that name.

pyproject gains a dev extra with pytest, which the job installs.

napalm-linux, which this driver builds on, is installed from git as well:
it is not on PyPI either.
2026-10-07 07:52:44 +02:00
christianmanivong cfe730ccea Merge pull request 'feat: declare that upgrading everything must be a full upgrade on OpenMediaVault' (#1) from feat/full-upgrade into master 2026-10-06 10:27:22 +00:00
Christian Manivong d61086ff5f feat: declare that upgrading everything must be a full upgrade on OpenMediaVault
A plain apt-get upgrade holds back OMV's own packages and the kernel;
omv-upgrade is a dist-upgrade. netOrk reads FULL_UPGRADE when it upgrades
the host (MVP 5).
2026-10-06 12:27:02 +02:00
4 changed files with 68 additions and 0 deletions
+50
View File
@@ -0,0 +1,50 @@
name: CI
on:
push:
branches: ["**"]
pull_request:
branches: ["**"]
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install package with dev extras
run: |
python -m pip install --upgrade pip
# napalm-device-types lives in git.netork.io/NAPALM, not on PyPI: without this
# pip looks there, finds an unrelated 0.1.0 and the job dies before any test.
python -m pip install "napalm-device-types @ git+https://git.netork.io/NAPALM/napalm-device-types.git"
# napalm-linux, which this driver builds on, is not on PyPI either.
python -m pip install "napalm-linux @ git+https://git.netork.io/NAPALM/napalm-linux.git"
python -m pip install -e ".[dev]"
- name: Run unit tests
run: |
python -m pytest -q --tb=short
- name: Build wheel and sdist
run: |
python -m pip install build
python -m build
- name: Upload dist artifacts
# v4 refuses to run on Gitea ("not currently supported on GHES").
uses: actions/upload-artifact@v3
with:
name: dist-${{ matrix.python-version }}
path: dist/*
+4
View File
@@ -53,6 +53,10 @@ class OpenMediaVaultDriver(StorageDriver, LinuxDriver):
TYPE_LABEL = "Storage" TYPE_LABEL = "Storage"
DRIVER_NAME = "openmediavault" DRIVER_NAME = "openmediavault"
#: "Upgrade everything" must be a full upgrade: OMV's own packages and the
#: kernel are held back by a plain ``apt-get upgrade`` (``omv-upgrade`` is a
#: dist-upgrade). netOrk reads this when it upgrades the host.
FULL_UPGRADE = True
driver_name = "openmediavault" driver_name = "openmediavault"
SSH_FINGERPRINT = [ SSH_FINGERPRINT = [
FingerprintRule("debian", weight=4.0), FingerprintRule("debian", weight=4.0),
+3
View File
@@ -28,6 +28,9 @@ dependencies = [
"napalm-linux>=0.1.0", "napalm-linux>=0.1.0",
] ]
[project.optional-dependencies]
dev = ["pytest"]
[project.entry-points."napalm.drivers"] [project.entry-points."napalm.drivers"]
openmediavault = "napalm_openmediavault:OpenMediaVaultDriver" openmediavault = "napalm_openmediavault:OpenMediaVaultDriver"
+11
View File
@@ -0,0 +1,11 @@
"""OMV says that "upgrade everything" must be a full upgrade on it.
A plain ``apt-get upgrade`` holds back OMV's own packages and the kernel;
``omv-upgrade`` runs a dist-upgrade. netOrk reads ``FULL_UPGRADE`` to choose.
"""
from napalm_openmediavault.openmediavault import OpenMediaVaultDriver
def test_a_full_upgrade_is_declared():
assert OpenMediaVaultDriver.FULL_UPGRADE is True