From 29f926a9afc169b8628b5f5ff20c875bc2e7cc9c Mon Sep 17 00:00:00 2001 From: Rich Megginson Date: Tue, 8 Dec 2020 10:37:15 -0700 Subject: [PATCH] use github actions instead of travis --- .github/workflows/tox.yml | 62 +++++++++++++++++++++++++++++++++++++++ README.md | 1 + tox-requirements.txt | 4 +++ tox.ini | 5 ---- travis-requirements.txt | 4 --- 5 files changed, 67 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/tox.yml create mode 100644 tox-requirements.txt delete mode 100644 travis-requirements.txt diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml new file mode 100644 index 0000000..7023dd8 --- /dev/null +++ b/.github/workflows/tox.yml @@ -0,0 +1,62 @@ +name: tox +on: # yamllint disable-line rule:truthy + - pull_request +jobs: + python: + runs-on: ubuntu-latest + strategy: + matrix: + pyver: ['2.7', '3.6', '3.7', '3.8', '3.9'] + steps: + - name: checkout PR + uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.pyver }} + - name: Install platform dependencies, python, tox + run: | + set -euxo pipefail + python -m pip install --upgrade pip + pip install -rtox_requirements.txt + - name: Run tox tests + run: | + set -euxo pipefail + tox + env: + COVERALLS_CMD: coveralls + COVERALLS_PARALLEL: "true" + python-26: + runs-on: ubuntu-16.04 + steps: + - name: checkout PR + uses: actions/checkout@v2 + - name: Install python, dependencies + run: | + set -euo pipefail + curl -sSf --retry 5 -o python-2.6.tar.bz2 ${PY26URL} + sudo tar xjf python-2.6.tar.bz2 --directory / + myuid=$(id -u) + mygid=$(id -g) + sudo chown -R $myuid:$mygid /home/travis/virtualenv + source /home/travis/virtualenv/python2.6/bin/activate + set -x + pip install -rtox_requirements.txt + env: + # yamllint disable-line rule:line-length + PY26URL: https://storage.googleapis.com/travis-ci-language-archives/python/binaries/ubuntu/14.04/x86_64/python-2.6.tar.bz2 + VIRTUAL_ENV_DISABLE_PROMPT: "true" + - name: Run tox tests + run: | + set -euo pipefail + source /home/travis/virtualenv/python2.6/bin/activate + set -x + tox -e py26-tox20 + env: + COVERALLS_CMD: "echo skipping coveralls" + SAFETY_CMD: "echo skipping safety" + VIRTUAL_ENV_DISABLE_PROMPT: "true" + - name: Coveralls + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index 85f23fd..899270a 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +![CI Status](https://github.com/linux-system-roles/auto-maintenance/workflows/tox/badge.svg) [![Coverage Status](https://coveralls.io/repos/github/linux-system-roles/tox-lsr/badge.svg?branch=main)](https://coveralls.io/github/linux-system-roles/tox-lsr?branch=main) # Linux System Roles Plugin for `tox` diff --git a/tox-requirements.txt b/tox-requirements.txt new file mode 100644 index 0000000..e11e205 --- /dev/null +++ b/tox-requirements.txt @@ -0,0 +1,4 @@ +tox<3 ; python_version < "2.7" +virtualenv==15.* ; python_version < "2.7" +pluggy==0.5.* ; python_version < "2.7" +coveralls ; python_version > "2.6" diff --git a/tox.ini b/tox.ini index a529bc4..25231f6 100644 --- a/tox.ini +++ b/tox.ini @@ -116,8 +116,3 @@ deps = commands = pydocstyle --add-ignore=D203,D212 setup.py src/tox_lsr pydocstyle --add-ignore=D101,D102,D103,D107,D203,D212 stubs tests/unit - -[travis] -python = - 2.6: py26-tox20 - 3.6: py36-tox30, black, isort, pylint, flake8, bandit, pydocstyle diff --git a/travis-requirements.txt b/travis-requirements.txt deleted file mode 100644 index 8edf5bf..0000000 --- a/travis-requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -idna<2.8 ; python_version < "2.7" -tox -tox-travis -coveralls