Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch from TravisCI to GitHub Actions #28

Merged
merged 4 commits into from
Apr 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
source =
result
omit =
setup.py
result/typetests.py

[report]
Expand Down
58 changes: 58 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
on:
push:
branches:
- master
pull_request:

name: CI

jobs:

test:
runs-on: ubuntu-latest
strategy:
matrix:
python:
- '3.5'
- '3.6'
- '3.7'
- '3.8'
name: Python ${{ matrix.python }}
steps:
# Python
- name: Setup python ${{ matrix.python }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python }}

# Check out code
- uses: actions/checkout@v2

# Cached dependencies
- uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-py${{ matrix.python }}-${{ hashFiles('**/requirements-dev.txt') }}
restore-keys: |
${{ runner.os }}-pip-py${{ matrix.python }}-
- name: Install dev dependencies
run: pip install -r requirements-dev.txt

# Install library
- name: Install result
run: pip install -e .

# Tests
- name: Run tests
run: pytest --cov-report term --cov-report xml:coverage.xml
- name: Run mypy on result.py
run: mypy result/result.py
- name: Run typetests
run: mypy result/typetests.py

# Coverage
- name: Upload coverage to codecov.io
uses: codecov/codecov-action@v1
if: matrix.python == '3.8'
with:
token: ${{ secrets.CODECOV_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.cache/
.coverage
coverage.xml
*.swp
*.pyc
__pycache__
Expand All @@ -8,3 +9,4 @@ dist/
build/
.idea/
.mypy_cache/
venv/
22 changes: 0 additions & 22 deletions .travis.yml

This file was deleted.

3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ Possible log types:

## Unreleased

...
- [deprecated] Python 3.4 support is deprecated and will be removed in the next
release

## [0.5.0] - 2020-03-03

Expand Down
10 changes: 5 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Result
======

.. image:: https://img.shields.io/travis/dbrgn/result/master.svg
:alt: Build status
:target: https://travis-ci.org/dbrgn/result
.. image:: https://img.shields.io/github/workflow/status/dbrgn/result/CI/master
:alt: GitHub Workflow Status (branch)
:target: https://github.com/dbrgn/result/actions?query=workflow%3ACI+branch%3Amaster

.. image:: https://img.shields.io/coveralls/dbrgn/result/master.svg
.. image:: https://codecov.io/gh/dbrgn/result/branch/master/graph/badge.svg
:alt: Coverage
:target: https://coveralls.io/github/dbrgn/result
:target: https://codecov.io/gh/dbrgn/result

A simple Result type for Python 3 `inspired by Rust
<https://doc.rust-lang.org/std/result/>`__, fully type annotated.
Expand Down
13 changes: 13 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
coverage:
precision: 2
round: nearest
range: "80...100"
status:
project:
default:
target: 85%
threshold: 3%
comment:
layout: "diff, flags, files"
behavior: default
require_changes: yes
12 changes: 0 additions & 12 deletions pytest.ini

This file was deleted.

6 changes: 3 additions & 3 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pytest==2.8.5
pytest-cov==2.2.0
pytest-pep8==1.0.6
pytest>=5,<6
pytest-cov>=2.8,<3
pytest-flake8>=1,<2
mypy==0.720
14 changes: 14 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,16 @@
[metadata]
license_file = LICENSE

[tool:pytest]
addopts = --flake8 --tb=short --cov=.
python_files = tests.py
norecursedirs = *.egg tmp* build .tox
flake8-ignore =
*.py E126 E127 E128 W504 F811 # Note: Remove F811 after the next flake8 upgrade
setup.py ALL
*/tests/* ALL
*/docs/* ALL
*/build/* ALL
*/venv/* ALL
*/TOXENV/* ALL
flake8-max-line-length = 99
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
'Development Status :: 4 - Beta',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
Expand Down