From 21526819259133fcbee7d1ecec610b764b8f72e9 Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Thu, 26 Aug 2021 19:35:13 +0200 Subject: [PATCH] Migrate nosetests to github actions --- .github/workflows/ci.yaml | 41 +++++++++++++++++++++++++++++++++++++++ .travis.yml | 31 ----------------------------- 2 files changed, 41 insertions(+), 31 deletions(-) delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ec275f4a..4520267e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -190,3 +190,44 @@ jobs: . venv/bin/activate python -m pip install -U pip setuptools wheel coveralls coverage pre-commit pytest-cov pytest-benchmark pytest --benchmark-disable --cov --cov-report= tests/ + + + nosetests-linux: + name: Run nosetests Python ${{ matrix.python-version }} (Linux) + runs-on: ubuntu-latest + needs: prepare-tests-linux + strategy: + fail-fast: false + matrix: + python-version: [3.6, 3.7, 3.8, 3.9, 3.10-dev] + steps: + - name: Check out code from GitHub + uses: actions/checkout@v2.3.4 + - name: Set up Python ${{ matrix.python-version }} + id: python + uses: actions/setup-python@v2.2.2 + with: + python-version: ${{ matrix.python-version }} + - name: Restore Python virtual environment + id: cache-venv + uses: actions/cache@v2.1.6 + with: + path: venv + key: + ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ + needs.prepare-tests-linux.outputs.python-key }} + - name: Fail job if Python cache restore failed + if: steps.cache-venv.outputs.cache-hit != 'true' + run: | + echo "Failed to restore Python venv from cache" + exit 1 + - name: Run nosetests + run: | + . venv/bin/activate + pip install safety pipenv numpy tzlocal nose coverage coveralls -U + pip freeze | safety check --stdin + nosetests -s --with-coverage --cover-inclusive --cover-package=prospector tests/ + mv .coverage .coverage.x + coverage run --parallel-mode prospector/run.py || true + coverage combine + coverage report --show-missing diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 70638bc4..00000000 --- a/.travis.yml +++ /dev/null @@ -1,31 +0,0 @@ -os: linux -dist: focal -language: python -python: - - "3.5" - - "3.6" - - "3.7" - - "3.8" - - "3.9" - - "nightly" -matrix: - allow_failures: - - python: "nightly" -install: - - "pip install --editable .[with_everything]" - - "pip install safety pipenv numpy tzlocal nose coverage coveralls -U" - - "pip freeze | safety check --stdin" -script: - - "nosetests -s --with-coverage --cover-inclusive --cover-package=prospector tests/" - - "mv .coverage .coverage.x" - - "coverage run --parallel-mode prospector/run.py || true" - - "coverage combine" - - "coverage report --show-missing" -after_success: - - | - prospector -0 - coveralls -notifications: - email: - on_failure: change - on_success: never