Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added tox to github actions #57

Merged
merged 6 commits into from
Aug 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.yml]
indent_size = 2
39 changes: 39 additions & 0 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Tests

on:
pull_request:
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

jobs:
test:
name: >-
${{ matrix.os }} v${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.9", "3.10", "3.11"]

steps:
- name: Check out repository code
uses: actions/checkout@v3

- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip wheel setuptools
python3 -m pip install '.[test]'

- name: Test with tox
run: tox run --quiet
11 changes: 3 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,8 @@
"phabricator",
"pyyaml",
]
tests_require = [
"coverage",
"flake8",
"pytest",
"tox",
]
docs_require = ["docs"]
tests_require = ["coverage", "flake8", "pytest", "tox", "tox-gh-actions"]
docs_require = ["mkdocs"]
download_url = f"https://github.com/dynamist/phabfive/tarball/v{phabfive.__version__}"

setup(
Expand All @@ -54,7 +49,7 @@
"phabfive = phabfive.cli:cli_entrypoint",
],
},
python_requires=">=3.9.*",
python_requires=">=3.9",
classifiers=[
# "Development Status :: 1 - Planning",
# "Development Status :: 2 - Pre-Alpha",
Expand Down
23 changes: 16 additions & 7 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
[tox]
envlist = flake8, py{38,39,310}, coverage, mkdocs
minversion = 3.4.0
envlist = py{39,310,311},flake8,coverage,mkdocs
basepython =
py39: python3.9
py310: python3.10
py311: python3.11

[testenv]
setenv =
PYTHONPATH = {toxinidir}
extras = test
sitepackages = False
commands = pytest -v {posargs}
commands =
pytest --basetemp={envtmpdir}

[testenv:flake8]
basepython = python3.8
extras = test
deps =
flake8-assertive
Expand All @@ -17,10 +24,10 @@ deps =
#flake8-docstrings
#flake8-import-order
flake8-rst-docstrings
commands = flake8
commands =
flake8 --exit-zero phabfive/ tests/

[testenv:mkdocs]
basepython = python3.8
extras = docs
commands = mkdocs build -s

Expand All @@ -34,6 +41,8 @@ commands =
[report]
show_missing = True

[travis]
[gh-actions]
python =
3.8: py38, flake8, coverage
3.9: py39
3.10: py310,flake8
3.11: py311