Skip to content
Open
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
31 changes: 31 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
# .. seealso:: https://github.com/ymyzk/tox-gh-actions
#
name: Tests
# yamllint disable-line rule:truthy
on:
- push
jobs:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 10
matrix:
python-version:
- 2.7
- 3.6
- 3.7
- 3.8

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: pip install tox tox-gh-actions
- name: Test with tox
run: tox

# vim:sw=2:ts=2:et:
12 changes: 2 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,9 @@ env:
- REMOVE_LOCALES=false
- REMOVE_LOCALES=true
install:
- pip install pyyaml coveralls flake8 flake8-import-order doc8
- if [[ $TRAVIS_PYTHON_VERSION != 2* ]]; then pip install sphinx; fi
- pip install .
- pip install tox-travis
- if [[ $REMOVE_LOCALES = "true" ]]; then sudo rm -rf /usr/lib/locale/*; fi
script:
- if [[ $TRAVIS_PYTHON_VERSION != nightly ]]; then flake8 .; fi
- if [[ $TRAVIS_PYTHON_VERSION != 2* ]]; then doc8 $(git ls-files '*.rst'); fi
- yamllint --strict $(git ls-files '*.yaml' '*.yml')
- coverage run --source=yamllint setup.py test
- if [[ $TRAVIS_PYTHON_VERSION != 2* ]]; then
python setup.py build_sphinx;
fi
- tox
after_success:
coveralls
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pathspec >= 0.5.3
pyyaml
setuptools
6 changes: 6 additions & 0 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pyyaml
coveralls
flake8
flake8-import-order
doc8
sphinx; python_version > '2.7'
37 changes: 37 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[tox]
envlist = py27, py34, py35, py36, py37, py38, nightly
minversion = 3.15

[gh-actions]
python =
2.7: py27
3.6: py36
3.7: py37
3.8: py38

[base]
commands =
- /bin/sh -c 'yamllint -c {toxinidir}/yamllint/conf/default.yaml --strict `git ls-files \*.yaml \*.yml`'
coverage run --source=yamllint setup.py test

[testenv]
deps =
-r {toxinidir}/requirements.txt
-r {toxinidir}/tests/requirements.txt

# https://tox.readthedocs.io/en/latest/config.html#substitution-for-values-from-other-sections
commands =
/bin/sh -c 'doc8 `git ls-files \*.rst`'
{[base]commands}
python setup.py build_sphinx

[testenv:py27]
commands =
flake8 .
{[base]commands}

# https://tox.readthedocs.io/en/latest/config.html#generative-section-names
[testenv:py3{4,5,6,7,8}]
commands =
flake8 .
{[testenv]commands}