Skip to content

Commit

Permalink
Travis CI → GitHub Actions (#292)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gallaecio committed Oct 4, 2021
1 parent e40ca4f commit c96e00b
Show file tree
Hide file tree
Showing 8 changed files with 114 additions and 71 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
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 TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_TOKEN }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_TOKEN }}
51 changes: 51 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Tests
on: [push, pull_request]

jobs:
tests:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-18.04
python-version: 2.7
env:
TOXENV: py27-scrapy10
- os: ubuntu-18.04
python-version: 2.7
env:
TOXENV: py27
- os: ubuntu-18.04
python-version: 3.4
env:
TOXENV: py
- os: ubuntu-18.04
python-version: 3.5
env:
TOXENV: py35
- python-version: 3.6
env:
TOXENV: py

steps:
- uses: actions/checkout@v2

- name: Run Splash
run: |
docker run --rm -d -p 8050:8050 --network host scrapinghub/splash
- 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
SPLASH_URL=http://127.0.0.1:8050 tox
- name: Upload coverage report
run: bash <(curl -s https://codecov.io/bash)
39 changes: 0 additions & 39 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Scrapy & JavaScript integration through Splash
:target: https://pypi.python.org/pypi/scrapy-splash
:alt: PyPI Version

.. image:: https://travis-ci.org/scrapy-plugins/scrapy-splash.svg?branch=master
:target: http://travis-ci.org/scrapy-plugins/scrapy-splash
.. image:: https://github.com/scrapy-plugins/scrapy-splash/workflows/Build/badge.svg
:target: https://github.com/scrapy-plugins/scrapy-splash/actions
:alt: Build Status

.. image:: http://codecov.io/github/scrapy-plugins/scrapy-splash/coverage.svg?branch=master
Expand Down
3 changes: 0 additions & 3 deletions requirements-py3.txt

This file was deleted.

6 changes: 0 additions & 6 deletions requirements-test.txt

This file was deleted.

3 changes: 0 additions & 3 deletions requirements.txt

This file was deleted.

46 changes: 28 additions & 18 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,44 @@
# and then run "tox" from this directory.

[tox]
envlist = py27,py34,py35,py36,py27-scrapy10
envlist = py27-scrapy10,py27,py34,py35,py36

[common]
deps =
pytest >= 3.3.2
pytest-cov >= 2.5.1
pytest-twisted >= 1.6
pytest-xdist >= 1.22
hypothesis >= 3.44.14
hypothesis-pytest
service_identity

[testenv]
passenv = SPLASH_URL
deps =
-rrequirements-test.txt
-rrequirements.txt

{[common]deps}
scrapy
commands =
pip install -e .
py.test --doctest-modules --cov=scrapy_splash {posargs:scrapy_splash tests}

[testenv:py34]
basepython = python3.4
[python2]
deps =
-rrequirements-test.txt
-rrequirements-py3.txt

[testenv:py35]
basepython = python3.5
deps = {[testenv:py34]deps}

[testenv:py36]
basepython = python3.6
deps = {[testenv:py34]deps}
{[common]deps}
queuelib < 1.6.0

[testenv:py27-scrapy10]
deps =
-rrequirements-test.txt
{[python2]deps}
scrapy < 1.1
service_identity

[testenv:py27]
deps =
{[python2]deps}
scrapy < 2

[testenv:py35]
deps =
{[common]deps}
# https://github.com/scrapy/scrapy/pull/4094#issuecomment-704092404
scrapy < 2

0 comments on commit c96e00b

Please sign in to comment.