Github workflow

This commit is contained in:
Liam Young 2022-02-05 08:15:08 +00:00
parent 0f1269fbc5
commit e46d66c1c7
3 changed files with 33 additions and 21 deletions

27
.github/workflows/tox.yaml vendored Normal file
View File

@ -0,0 +1,27 @@
name: Python package
on:
- push
- pull_request
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
- name: Lint with tox
run: tox -e pep8
- name: Test with tox
run: tox -e py${{ matrix.python-version }}

View File

@ -15,7 +15,6 @@ develop a new k8s charm using the Operator Framework:
import logging
from typing import List
import ops.framework
from ops.framework import StoredState
from ops.main import main
@ -45,10 +44,6 @@ class OVNRelayOperatorCharm(ovn_charm.OSBaseOVNOperatorCharm):
_state = StoredState()
def __init__(self, framework: ops.framework.Framework) -> None:
"""Run constructor."""
super().__init__(framework)
def get_pebble_handlers(self):
pebble_handlers = [
OVNRelayPebbleHandler(

22
tox.ini
View File

@ -35,26 +35,16 @@ whitelist_externals =
passenv = HOME TERM CS_* OS_* TEST_*
deps = -r{toxinidir}/test-requirements.txt
[testenv:py35]
basepython = python3.5
# python3.5 is irrelevant on a focal+ charm.
commands = /bin/true
[testenv:py36]
basepython = python3.6
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
[testenv:py37]
basepython = python3.7
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
[testenv:py38]
[testenv:py3.8]
basepython = python3.8
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
[testenv:py3.9]
basepython = python3.9
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
[testenv:py3]
basepython = python3
deps = -r{toxinidir}/requirements.txt