Skip to content

Commit

Permalink
Add GitHub Actions CI, test with 3.9 to 3.11 (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiran authored Jul 11, 2022
1 parent bdbcc5d commit 51f5bfe
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 3 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
name: CI

on:
push:
branches: [ "master", "v*" ]
pull_request:
branches: [ "master", "v*" ]
workflow_dispatch:

permissions:
contents: read

jobs:
tests:
name: "Python ${{ matrix.python-version }}"
# 20.04 because https://github.com/actions/python-versions
# does not have 2.7 and 3.6 binaries for 22.04.
runs-on: "ubuntu-20.04"
strategy:
fail-fast: false
matrix:
python-version:
- "2.7"
- "3.6"
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11-dev"
steps:
- uses: "actions/checkout@v3"
- uses: "actions/setup-python@v4"
with:
python-version: "${{ matrix.python-version }}"
cache: "pip"
- name: "Update pip"
run: python -m pip install --upgrade pip setuptools wheel
- name: "Install tox dependencies"
run: python -m pip install --upgrade tox tox-gh-actions
- name: "Run tox for ${{ matrix.python-version }}"
run: "python -m tox"
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Topic :: Communications
Topic :: System :: Monitoring
Topic :: System :: Networking :: Monitoring
Expand Down
28 changes: 25 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[tox]
minversion = 3.4.0
envlist =
{py27, py35, py36, py37, py38}-{unittest},
cover, docs, bandit, build
{py27, py35, py36, py37, py38, py39, py310, py311}-{unittest},
cover, bandit, build
isolated_build = true
skip_missing_interpreters = true

Expand Down Expand Up @@ -43,8 +43,20 @@ commands = {[testenv:unittest]commands}
deps = {[testenv:unittest]deps}
commands = {[testenv:unittest]commands}

[testenv:py39-unittest]
deps = {[testenv:unittest]deps}
commands = {[testenv:unittest]commands}

[testenv:py310-unittest]
deps = {[testenv:unittest]deps}
commands = {[testenv:unittest]commands}

[testenv:py311-unittest]
deps = {[testenv:unittest]deps}
commands = {[testenv:unittest]commands}

[testenv:cover]
basepython = python3.7
basepython = python3
setenv =
{[testenv]setenv}
PYTHON=coverage run --parallel-mode
Expand All @@ -70,3 +82,13 @@ deps =
setuptools
commands =
python setup.py -q sdist bdist_wheel

[gh-actions]
python =
2.7: py27-unittest
3.6: py36-unittest
3.7: py37-unittest
3.8: py38-unittest
3.9: py39-unittest, bandit
3.10: py310-unittest, cover, build
3.11: py311-unittest

0 comments on commit 51f5bfe

Please sign in to comment.