diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..84ee2faf --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,68 @@ +name: Tests +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + + +jobs: + tests: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - python-version: "2.7" + env: + TOXENV: "msgpack" + - python-version: "2.7" + env: + TOXENV: "json" + - python-version: "pypy3" + env: + TOXENV: "msgpack" + - python-version: "pypy3" + env: + TOXENV: "json" + + - python-version: "3.6" + env: + TOXENV: "msgpack" + - python-version: "3.6" + env: + TOXENV: "json" + - python-version: "3.7" + env: + TOXENV: "msgpack" + - python-version: "3.7" + env: + TOXENV: "json" + - python-version: "3.8" + env: + TOXENV: "msgpack" + - python-version: "3.8" + env: + TOXENV: "json" + - python-version: "3.9" + env: + TOXENV: "msgpack" + - python-version: "3.9" + env: + TOXENV: "json" + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Run tests + env: ${{ matrix.env }} + run: | + pip install -U tox + tox + + - name: Upload to codecov + uses: codecov/codecov-action@v2 \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..ef18faf6 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,26 @@ +name: Publish +on: + release: + types: [published] + +jobs: + publish: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python 3 + uses: actions/setup-python@v2 + with: + python-version: 3 + + - name: Build distribution + run: | + pip install -U setuptools wheel + python setup.py sdist bdist_wheel + + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_TOKEN }} \ No newline at end of file diff --git a/.travis-workarounds.sh b/.travis-workarounds.sh deleted file mode 100755 index 5c34e54f..00000000 --- a/.travis-workarounds.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -set -e -set -x - -if [[ "${TOXENV}" == "pypy" ]]; then - sudo add-apt-repository -y ppa:pypy/ppa - sudo apt-get -qy update - sudo apt-get install -y pypy pypy-dev - # This is required because we need to get rid of the Travis installed PyPy - # or it'll take precedence over the PPA installed one. - sudo rm -rf /usr/local/pypy/bin -fi - -# Workaround travis-ci/travis-ci#2065 -pip install -U wheel diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 010be11a..00000000 --- a/.travis.yml +++ /dev/null @@ -1,43 +0,0 @@ -language: python -matrix: - include: - - python: 2.7 - env: TOXENV=py27-json - - python: 2.7 - env: TOXENV=py27-msgpack - - python: pypy - env: TOXENV=pypy-json - - python: pypy - env: TOXENV=pypy-msgpack - - python: 3.5 - env: TOXENV=py35-json - - python: 3.5 - env: TOXENV=py35-msgpack - - python: 3.6 - env: TOXENV=py36-json - - python: 3.6 - env: TOXENV=py36-msgpack - - python: 3.7 - dist: xenial - env: TOXENV=py37-json - - python: 3.7 - dist: xenial - env: TOXENV=py37-msgpack -install: - - pip install -U tox coverage codecov pytest-xdist -script: - - tox -after_success: - - codecov -cache: - directories: - - $HOME/.cache/pip -deploy: - provider: pypi - distributions: sdist bdist_wheel - on: - tags: true - condition: $TOXENV == py27-msgpack && $TRAVIS_TAG =~ ^[0-9]+[.][0-9]+[.][0-9]+(rc[0-9]+|[.]dev[0-9]+)?$ - user: scrapinghub - password: - secure: SMPghJT7GScj6jQBimk8r58vRNfbKQQkXvfh5DJC38d0XeNtpBJQ750LT7Zlw8R+qAadT8sA7M1YYZY8mIQgdakQv48zX7EVxyc/8a2rAOF9p/ikRn0Dc50Qzr9U5Rtbsp7PMYlmUyeo9VjrStPPkHUPW2Q7vprTpdFrlDaf3WA= diff --git a/tox.ini b/tox.ini index 94e8ec58..950b849c 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,7 @@ # and then run "tox" from this directory. [tox] -envlist = py{27,py,35,36,37}-{json,msgpack} +envlist = py{36,py3,37,38,39}-{json,msgpack} [testenv] deps = @@ -12,4 +12,4 @@ deps = -r{toxinidir}/requirements-test.txt msgpack: -r{toxinidir}/requirements.txt pypy-msgpack: -r{toxinidir}/requirements-pypy.txt -commands = py.test --cov=scrapinghub --cov-report= +commands = py.test --cov=scrapinghub --cov-report=xml \ No newline at end of file