From 928f3adc93785629be887209c1ab6db37cf98d75 Mon Sep 17 00:00:00 2001 From: Achilles Rasquinha Date: Sat, 25 Mar 2023 22:27:43 -0500 Subject: [PATCH] ci: setup ci --- .github/workflows/ci.yml | 47 ++++++++++++++++++++++++++++++++++++++++ requirements-test.txt | 8 +++++++ tox.ini | 24 ++++++++++++++++++++ 3 files changed, 79 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 requirements-test.txt create mode 100644 tox.ini diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..cabbcfc --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,47 @@ +name: Continuous Integration + +on: [push, pull_request] + +env: + COVERALLS_REPO_TOKEN: ${{ secrets.VCS_TOKEN }} + GITHUB_TOKEN: ${{ secrets.VCS_TOKEN }} + + ENVIRONMENT: test + VERBOSE: true + TERM: xterm + +jobs: + test: + name: Test + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9] + + steps: + - uses: actions/checkout@v2 + - name: Show ref + run: | + echo "Checking out $GITHUB_REF..." + - uses: actions/setup-python@v2 + name: Set up Python ${{ matrix.python-version }} + with: + python-version: ${{ matrix.python-version }} + - name: Upgrade PIP and packages + run: | + python -m pip install --upgrade pip setuptools wheel + - name: Install dependencies + run: | + # pip install -r requirements-dev.txt + # python setup.py develop + pip install -e . + - name: Run Tests + run: | + pip install -r ./requirements-test.txt + python -m tox -e py$(echo "${{ matrix.python-version }}" | tr -d '.') --parallel all + - name: Run Coverage + run: | + coveralls --service github \ No newline at end of file diff --git a/requirements-test.txt b/requirements-test.txt new file mode 100644 index 0000000..0a6a447 --- /dev/null +++ b/requirements-test.txt @@ -0,0 +1,8 @@ +pytest +pytest-cov +pytest-xdist +pytest-sugar +pytest-clarity; python_version >= '3.6' +tox +coveralls +pluggy<1,>=0.12.0 \ No newline at end of file diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..82ed35e --- /dev/null +++ b/tox.ini @@ -0,0 +1,24 @@ +[tox] +envlist = + py27 + py34 + py35 + py36 + py37 + py38 + py39 + py310 + pypy + +skip_missing_interpreters = + true + +[testenv] +passenv = * +deps = + -r requirements-test.txt +setenv = + PYTEST_ADDOPTS = "--color=yes" +commands = + pytest -s {toxinidir}/tests \ + --cov {envsitepackagesdir}/sirad \ No newline at end of file