From ea9d1ae67c00c8d05366fbfdc8decfdc8eb98780 Mon Sep 17 00:00:00 2001 From: Pawel Miech Date: Mon, 27 Dec 2021 12:37:28 +0100 Subject: [PATCH 1/5] switch from Travis to GH actions --- .github/workflows/main.yml | 30 ++++++++++++++++++++++++++ .travis-workarounds.sh | 15 ------------- .travis.yml | 43 -------------------------------------- tox.ini | 15 ------------- 4 files changed, 30 insertions(+), 73 deletions(-) create mode 100644 .github/workflows/main.yml delete mode 100755 .travis-workarounds.sh delete mode 100644 .travis.yml delete mode 100644 tox.ini diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..c33151b1 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,30 @@ +name: Run tests + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.6", "3.7", "3.8", "3.9"] + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version}} + uses: actions/setup-python@v2 + with: + python-version: ${{matrix.python-version}} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install -r requirements-test.txt + - name: Run tests + run: | + pytest \ 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 deleted file mode 100644 index 94e8ec58..00000000 --- a/tox.ini +++ /dev/null @@ -1,15 +0,0 @@ -# Tox (http://tox.testrun.org/) is a tool for running tests -# in multiple virtualenvs. This configuration file will run the -# test suite on all supported python versions. To use it, "pip install tox" -# and then run "tox" from this directory. - -[tox] -envlist = py{27,py,35,36,37}-{json,msgpack} - -[testenv] -deps = - -r{toxinidir}/requirements-base.txt - -r{toxinidir}/requirements-test.txt - msgpack: -r{toxinidir}/requirements.txt - pypy-msgpack: -r{toxinidir}/requirements-pypy.txt -commands = py.test --cov=scrapinghub --cov-report= From 305767d24674ec59ab09083af2214ad6a160d2ee Mon Sep 17 00:00:00 2001 From: Pawel Miech Date: Mon, 27 Dec 2021 13:54:20 +0100 Subject: [PATCH 2/5] bring back tox.ini --- tox.ini | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 tox.ini diff --git a/tox.ini b/tox.ini new file mode 100644 index 00000000..94e8ec58 --- /dev/null +++ b/tox.ini @@ -0,0 +1,15 @@ +# Tox (http://tox.testrun.org/) is a tool for running tests +# in multiple virtualenvs. This configuration file will run the +# test suite on all supported python versions. To use it, "pip install tox" +# and then run "tox" from this directory. + +[tox] +envlist = py{27,py,35,36,37}-{json,msgpack} + +[testenv] +deps = + -r{toxinidir}/requirements-base.txt + -r{toxinidir}/requirements-test.txt + msgpack: -r{toxinidir}/requirements.txt + pypy-msgpack: -r{toxinidir}/requirements-pypy.txt +commands = py.test --cov=scrapinghub --cov-report= From 8a2c20aa3550ab6a9a070f5e6ddc2d662a007ed4 Mon Sep 17 00:00:00 2001 From: Pawel Miech Date: Mon, 27 Dec 2021 17:58:45 +0100 Subject: [PATCH 3/5] workflow with tox, publish workflow --- .github/workflows/main.yml | 51 ++++++++++++++++++++++++++--------- .github/workflows/publish.yml | 26 ++++++++++++++++++ tox.ini | 2 +- 3 files changed, 65 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c33151b1..dfbc4120 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,30 +1,55 @@ -name: Run tests - +name: Tests on: push: branches: [ master ] pull_request: branches: [ master ] + jobs: - build: + tests: runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - python-version: ["3.6", "3.7", "3.8", "3.9"] + matrix: + include: + - 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}} + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: - python-version: ${{matrix.python-version}} + python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - pip install -r requirements-test.txt - name: Run tests + env: ${{ matrix.env }} run: | - pytest \ No newline at end of file + pip install -U tox + tox + + - name: Upload coverage report + run: bash <(curl -s https://codecov.io/bash) \ 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/tox.ini b/tox.ini index 94e8ec58..eb375824 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,37,38,39}-{json,msgpack} [testenv] deps = From 9180b3517d64e83ac0095a73edc8a38955e2c539 Mon Sep 17 00:00:00 2001 From: Pawel Miech Date: Mon, 27 Dec 2021 18:52:04 +0100 Subject: [PATCH 4/5] add pypy and 2.7 --- .github/workflows/main.yml | 13 +++++++++++++ tox.ini | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dfbc4120..ba70eedf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,6 +13,19 @@ jobs: 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" diff --git a/tox.ini b/tox.ini index eb375824..43d63897 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,7 @@ # and then run "tox" from this directory. [tox] -envlist = py{36,37,38,39}-{json,msgpack} +envlist = py{36,py3,37,38,39}-{json,msgpack} [testenv] deps = From 0d4b022cd6fe92044c6701ef397f17dc8f3199bd Mon Sep 17 00:00:00 2001 From: Pawel Miech Date: Tue, 28 Dec 2021 08:17:21 +0100 Subject: [PATCH 5/5] [workflows] add proper codecov action --- .github/workflows/main.yml | 4 ++-- tox.ini | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ba70eedf..84ee2faf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -64,5 +64,5 @@ jobs: pip install -U tox tox - - name: Upload coverage report - run: bash <(curl -s https://codecov.io/bash) \ No newline at end of file + - name: Upload to codecov + uses: codecov/codecov-action@v2 \ No newline at end of file diff --git a/tox.ini b/tox.ini index 43d63897..950b849c 100644 --- a/tox.ini +++ b/tox.ini @@ -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