Bump CI
Signed-off-by: Bernát Gábor <gaborjbernat@gmail.com>
This commit is contained in:
parent
79812afc97
commit
8679c0af7c
|
@ -0,0 +1,6 @@
|
||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: "github-actions"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "daily"
|
|
@ -3,52 +3,95 @@ on:
|
||||||
push:
|
push:
|
||||||
pull_request:
|
pull_request:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "0 8 * * *"
|
- cron: "0 8 * * *"
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: check-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
name: Test on ${{ matrix.py }} under ${{ matrix.os }}
|
name: test ${{ matrix.py }}
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ubuntu-22.04
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os:
|
|
||||||
- Ubuntu-latest
|
|
||||||
py:
|
py:
|
||||||
- 3.9
|
- "3.10"
|
||||||
- 3.8
|
- "3.9"
|
||||||
- 3.7
|
- "3.8"
|
||||||
- 3.6
|
- "3.7"
|
||||||
- 3.5
|
|
||||||
- 2.7
|
|
||||||
- pypy3
|
|
||||||
- pypy2
|
|
||||||
steps:
|
steps:
|
||||||
- name: Setup graphviz
|
- name: Install OS dependencies
|
||||||
uses: ts-graphviz/setup-graphviz@v1
|
run: |
|
||||||
- name: Setup python for tox
|
for i in 1 2 3; do
|
||||||
uses: actions/setup-python@v2
|
echo "try $i" && sudo apt-get update -y && sudo apt-get install graphviz -y && exit 0;
|
||||||
with:
|
done
|
||||||
python-version: 3.8
|
exit 1
|
||||||
- name: Install tox
|
shell: bash
|
||||||
run: python -m pip install tox
|
- name: setup python for tox
|
||||||
- name: Setup python for test ${{ matrix.py }}
|
uses: actions/setup-python@v4
|
||||||
uses: actions/setup-python@v2
|
with:
|
||||||
with:
|
python-version: "3.10"
|
||||||
python-version: ${{ matrix.py }}
|
- name: install tox
|
||||||
- uses: actions/checkout@v2
|
run: python -m pip install tox
|
||||||
- name: Pick tox environment to run
|
- uses: actions/checkout@v3
|
||||||
run: |
|
- name: setup python for test ${{ matrix.py }}
|
||||||
import os
|
uses: actions/setup-python@v4
|
||||||
import platform
|
with:
|
||||||
import sys
|
python-version: ${{ matrix.py }}
|
||||||
major, minor, impl = sys.version_info[0], sys.version_info[1], platform.python_implementation()
|
- name: Pick environment to run
|
||||||
toxenv = ("py" if impl == "CPython" else "pypy") + ("{}{}".format(major, minor) if impl == "CPython" else ("3" if major == 3 else ""))
|
run: |
|
||||||
env_file = open(os.environ['GITHUB_ENV'], "a")
|
import codecs; import os; import sys
|
||||||
env_file.write("TOXENV={}\n".format(toxenv))
|
env = "TOXENV=py3{}\n".format(sys.version_info[1])
|
||||||
env_file.close()
|
print("Picked:\n{}for{}".format(env, sys.version))
|
||||||
shell: python
|
with codecs.open(os.environ["GITHUB_ENV"], "a", "utf-8") as file_handler:
|
||||||
- name: Setup test suite
|
file_handler.write(env)
|
||||||
run: tox -vv --notest
|
shell: python
|
||||||
- name: Run test suite
|
- name: setup test suite
|
||||||
run: tox --skip-pkg-install
|
run: tox -vv --notest
|
||||||
|
- name: run test suite
|
||||||
|
run: tox --skip-pkg-install
|
||||||
|
|
||||||
|
check:
|
||||||
|
name: tox env ${{ matrix.tox_env }}
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
tox_env:
|
||||||
|
- dev
|
||||||
|
- readme
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: setup Python 3.10
|
||||||
|
uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: "3.10"
|
||||||
|
- name: install tox
|
||||||
|
run: python -m pip install tox
|
||||||
|
- name: run check for ${{ matrix.tox_env }}
|
||||||
|
run: python -m tox -e ${{ matrix.tox_env }}
|
||||||
|
env:
|
||||||
|
UPGRADE_ADVISORY: "yes"
|
||||||
|
|
||||||
|
publish:
|
||||||
|
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
|
||||||
|
needs: [check, test]
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
steps:
|
||||||
|
- name: setup python to build package
|
||||||
|
uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: "3.10"
|
||||||
|
- name: install build
|
||||||
|
run: python -m pip install build
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: build package
|
||||||
|
run: python -m build --sdist --wheel . -o dist
|
||||||
|
- name: publish to PyPI
|
||||||
|
uses: pypa/gh-action-pypi-publish@v1.5.1
|
||||||
|
with:
|
||||||
|
skip_existing: true
|
||||||
|
user: __token__
|
||||||
|
password: ${{ secrets.pypi_password }}
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
[build-system]
|
||||||
|
requires = ["setuptools>=65.1.1"]
|
||||||
|
build-backend = "setuptools.build_meta"
|
48
tox.ini
48
tox.ini
|
@ -1,26 +1,42 @@
|
||||||
# http://tox.readthedocs.org/ - sets up and runs the test suite based on a declarative configuration
|
|
||||||
[tox]
|
[tox]
|
||||||
envlist =
|
envlist =
|
||||||
py39
|
fix
|
||||||
py38
|
py310
|
||||||
py37
|
py39
|
||||||
py36
|
py38
|
||||||
py35
|
py37
|
||||||
py34
|
readme
|
||||||
py27
|
isolated_build = true
|
||||||
pypy3
|
skip_missing_interpreters = true
|
||||||
pypy2
|
minversion = 3.14
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
description = run test suite under {basepython}
|
description = run test suite under {basepython}
|
||||||
commands =
|
commands =
|
||||||
pytest {posargs:-vv}
|
pytest {posargs:-vv}
|
||||||
deps =
|
deps =
|
||||||
graphviz
|
graphviz>=0.20.1
|
||||||
pip>=8.0.2
|
pip>=22.2.2
|
||||||
pytest
|
pytest>=7.1.3
|
||||||
pytest-cov
|
pytest-cov>=3
|
||||||
virtualenv>=20,<21
|
virtualenv<21,>=20.16.4
|
||||||
mock;python_version<"3"
|
|
||||||
extras =
|
extras =
|
||||||
graphviz
|
graphviz
|
||||||
|
|
||||||
|
[testenv:readme]
|
||||||
|
description = check that the long description is valid
|
||||||
|
basepython = python3.10
|
||||||
|
skip_install = true
|
||||||
|
deps =
|
||||||
|
build[virtualenv]>=0.8
|
||||||
|
twine>=4.0.1
|
||||||
|
commands =
|
||||||
|
python -m build --sdist --wheel -o {envtmpdir} .
|
||||||
|
twine check {envtmpdir}/*
|
||||||
|
|
||||||
|
[testenv:dev]
|
||||||
|
description = generate a DEV environment
|
||||||
|
usedevelop = true
|
||||||
|
commands =
|
||||||
|
python -m pip list --format=columns
|
||||||
|
python -c 'import sys; print(sys.executable)'
|
||||||
|
|
Loading…
Reference in New Issue