Skip to content

Commit

Permalink
Gh actions for test and lint (#135)
Browse files Browse the repository at this point in the history
* Cleanup tests and linting

Update tox to supported python3 versions, fix an outdated test, and sort
out a couple of linting recommendations. Ignore the lint advice for
formatting using f strings, as this project does not use f strings.

* Add github action for running tests
  • Loading branch information
Jamstah authored Mar 1, 2022
1 parent bf43848 commit 9bce697
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
25 changes: 25 additions & 0 deletions .github/workflows/test-and-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Python package

on:
- push
- pull_request

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10']

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
python -m pip install tox tox-gh-actions
- name: Test with tox
run: tox
9 changes: 8 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,19 @@
envlist = py37, py38, py39, py310, lint
skip_missing_interpreters = True

[gh-actions]
python =
3.7: py37
3.8: py38
3.9: py39
3.10: py310, lint

[testenv]
setenv =
LANG=en_US.UTF-8
PYTHONPATH = {toxinidir}:{toxinidir}/RFXtrx
commands =
py.test -v --timeout=30 --cov --cov-report= {posargs}
py.test -v --timeout=30 --cov --cov-report= {posargs}
py.test --doctest-modules doctest/
deps =
-r{toxinidir}/requirements.txt
Expand Down

0 comments on commit 9bce697

Please sign in to comment.