From 8442dee72aec681a6a878976dccfca8d62b78b3f Mon Sep 17 00:00:00 2001 From: Rich Megginson Date: Wed, 9 Dec 2020 19:58:31 -0700 Subject: [PATCH] use github actions instead of travis --- .github/workflows/tox.yml | 74 +++++++++++++++++++++++++++++++++++++++ .travis.yml | 29 --------------- README.md | 1 + tox.ini | 9 ----- 4 files changed, 75 insertions(+), 38 deletions(-) create mode 100644 .github/workflows/tox.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml new file mode 100644 index 0000000..a9a1b32 --- /dev/null +++ b/.github/workflows/tox.yml @@ -0,0 +1,74 @@ +# yamllint disable rule:line-length +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'] + 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 + run: | + set -euxo pipefail + .travis/preinstall + - name: Install pip, tox, python dependencies + run: | + set -euxo pipefail + python -m pip install --upgrade pip + pip install tox + - name: Run tox tests + run: | + set -euxo pipefail + toxpyver=$(echo "${{ matrix.pyver }}" | tr -d .) + toxenvs="py${toxpyver}" + case "$toxpyver" in + 27) toxenvs="${toxenvs},coveralls,flake8,pylint,custom" ;; + 36) toxenvs="${toxenvs},coveralls,black,yamllint,shellcheck,custom,collection" ;; + 37) toxenvs="${toxenvs},coveralls,custom" ;; + 38) toxenvs="${toxenvs},coveralls,custom" ;; + esac + TOXENV="$toxenvs" .travis/runtox + env: + LSR_ANSIBLES: 'ansible==2.7.* ansible==2.8.* ansible==2.9.*' + LSR_MSCENARIOS: default + 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 + python --version + pip --version + .travis/preinstall + sudo pip install 'tox<3' 'virtualenv==15.*' 'pluggy==0.5.*' + sudo pip list + env: + 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,coveralls,custom + env: + LSR_ANSIBLES: 'ansible==2.7.* ansible==2.8.* ansible==2.9.*' + LSR_MSCENARIOS: default + VIRTUAL_ENV_DISABLE_PROMPT: "true" diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 7c9aa37..0000000 --- a/.travis.yml +++ /dev/null @@ -1,29 +0,0 @@ -# SPDX-License-Identifier: MIT ---- -dist: bionic -language: python -env: - global: - - LSR_ANSIBLES='ansible==2.7.* ansible==2.8.* ansible==2.9.*' - - LSR_MSCENARIOS='default' -matrix: - include: - - python: 2.6 - dist: trusty - - python: 2.7 - - python: 3.6 - - python: 3.7 - - python: 3.8 - - python: 3.8-dev - -services: - - docker - -before_install: - - ./.travis/preinstall - -install: - - pip install tox tox-travis - -script: - - ./.travis/runtox diff --git a/README.md b/README.md index aa4dc67..be92b3d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ nbde_client ----------- +![CI Testing](https://github.com/linux-system-roles/nbde_client/workflows/tox/badge.svg) Ansible role for configuring Network-Bound Disk Encryption clients (e.g. clevis). diff --git a/tox.ini b/tox.ini index 7803444..b81408a 100644 --- a/tox.ini +++ b/tox.ini @@ -205,12 +205,3 @@ disable = wrong-import-position [pycodestyle] max-line-length = 88 - -[travis] -python = - 2.6: py26,coveralls,custom - 2.7: py27,coveralls,flake8,pylint,custom - 3.6: py36,coveralls,black,yamllint,shellcheck,custom,collection - 3.7: py37,coveralls,custom - 3.8: py38,coveralls,custom - 3.8-dev: py38,coveralls,custom