Skip to content

Commit

Permalink
Run tests with Github Actions instead of Travis CI
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasLM committed Nov 20, 2020
1 parent 67fe1d3 commit ddac384
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 29 deletions.
1 change: 1 addition & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[run]
relative_files = True
include =
spinach/*
28 changes: 28 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Upload Python Package

on:
release:
types: [created]

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
54 changes: 54 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Run tests

on: ["push", "pull_request"]

jobs:

test:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.5, 3.6, 3.7, 3.8, 3.9, pypy3]

services:
redis:
image: redis
ports:
- 6379:6379

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 -e .[tests]
- name: Lint
run: |
pycodestyle --ignore=E252,W503,W504 spinach tests
- name: Test with pytest
run: |
pytest -v --cov=spinach tests/
- name: Coveralls
uses: AndreMiras/coveralls-python-action@develop
with:
parallel: true


coveralls_finish:
needs: test
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: AndreMiras/coveralls-python-action@develop
with:
parallel-finished: true
27 changes: 0 additions & 27 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
@@ -1,8 +1,8 @@
Spinach
=======

.. image:: https://travis-ci.org/NicolasLM/spinach.svg?branch=master
:target: https://travis-ci.org/NicolasLM/spinach
.. image:: https://github.com/NicolasLM/spinach/workflows/Run%20tests/badge.svg?branch=master
:target: https://github.com/NicolasLM/spinach/actions
.. image:: https://coveralls.io/repos/github/NicolasLM/spinach/badge.svg?branch=master
:target: https://coveralls.io/github/NicolasLM/spinach?branch=master
.. image:: https://readthedocs.org/projects/spinach/badge/?version=latest
Expand Down

0 comments on commit ddac384

Please sign in to comment.