Switch from Travis CI and Coveralls to GH Actions and Codecov

Free Travis CI is shutting down and since I already have Codecov set up
in other projects instead of Coveralls I'm switching that too for
consistency.

There's no nightly so I left it out for now.
This commit is contained in:
Jakub Stasiak 2021-02-11 18:06:03 +01:00
parent dcc9e6772a
commit d0534882a6
5 changed files with 35 additions and 28 deletions

28
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,28 @@
name: CI
on: [push, pull_request]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.6, 3.7, 3.8, 3.9, pypy3]
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: |
pip install --upgrade -r requirements.txt -r requirements-dev.txt
pip install .
- name: Run tests
run: |
py.test -vv --cov=injector --cov-branch --cov-report html --cov-report term
if which mypy; then mypy injector ; fi
if which black; then black --check . ; fi
- name: Report coverage to Codecov
uses: codecov/codecov-action@v1

View File

@ -1,21 +0,0 @@
sudo: false
language: python
cache: pip
python:
- "3.6"
- "3.7"
- "3.8"
- "3.9"
- "nightly"
- "pypy3"
matrix:
allow_failures:
- python: "nightly"
install:
- pip install --upgrade -r requirements.txt -r requirements-dev.txt
script:
- py.test -vv --cov=injector --cov-branch --cov-report html --cov-report term
- if [[ "${TRAVIS_PYTHON_VERSION}" != "pypy"* ]] ; then mypy injector ; fi
- if [[ "${TRAVIS_PYTHON_VERSION}" != "pypy"* ]] ; then black --check . ; fi
after_success:
- coveralls

View File

@ -1,8 +1,8 @@
Injector - Python dependency injection framework, inspired by Guice
===================================================================
[![image](https://secure.travis-ci.org/alecthomas/injector.svg?branch=master)](https://travis-ci.org/alecthomas/injector)
[![Coverage Status](https://coveralls.io/repos/github/alecthomas/injector/badge.svg?branch=master)](https://coveralls.io/github/alecthomas/injector?branch=master)
[![image](https://github.com/alecthomas/injector/workflows/CI/badge.svg)](https://github.com/alecthomas/injector/actions?query=workflow%3ACI+branch%3Amaster)
[![Coverage Status](https://codecov.io/gh/alecthomas/injector/branch/master/graph/badge.svg)](https://codecov.io/gh/alecthomas/injector)
Introduction
------------

View File

@ -6,13 +6,14 @@
Welcome to Injector's documentation!
====================================
.. image:: https://travis-ci.org/alecthomas/injector.png?branch=master
.. image:: https://github.com/alecthomas/injector/workflows/CI/badge.svg
:alt: Build status
:target: https://travis-ci.org/alecthomas/injector
:target: https://github.com/alecthomas/injector/actions?query=workflow%3ACI+branch%3Amaster
.. image:: https://coveralls.io/repos/github/alecthomas/injector/badge.svg?branch=master
.. image:: https://codecov.io/gh/alecthomas/injector/branch/master/graph/badge.svg
:alt: Covergage status
:target: https://coveralls.io/github/alecthomas/injector?branch=master
:target: https://codecov.io/gh/alecthomas/injector
GitHub (code repository, issues): https://github.com/alecthomas/injector

View File

@ -1,5 +1,4 @@
pytest
coveralls
pytest-cov>=2.5.1
dataclasses;python_version<"3.7"
mypy;implementation_name=="cpython"