Skip to content

Commit

Permalink
ci: migrate to GA
Browse files Browse the repository at this point in the history
  • Loading branch information
mvidalgarcia authored and Diego committed Dec 3, 2020
1 parent 29072d3 commit b5c7e28
Show file tree
Hide file tree
Showing 10 changed files with 102 additions and 78 deletions.
4 changes: 2 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ indent_size = 4
[*.{css,html,js,json,yml}]
indent_size = 2

# Matches the exact files either package.json or .travis.yml
[{package.json,.travis.yml}]
# Matches the exact files either package.json or .github/workflows/*.yml
[{package.json,.github/workflows/*.yml}]
indent_size = 2

# Dockerfile
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/pypi-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Publish

on:
push:
tags:
- v*

jobs:
Publish:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.7

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel
- name: Build package
# Remove `compile_catalog` if the package has no translations.
run: |
python setup.py sdist bdist_wheel
- name: Publish on PyPI
uses: pypa/[email protected]
with:
user: __token__
# The token is provided by the inveniosoftware organization
password: ${{ secrets.pypi_token }}
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: CI

on:
push:
branches: master
pull_request:
branches: master
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '0 3 * * 6'
workflow_dispatch:
inputs:
reason:
description: 'Reason'
required: false
default: 'Manual trigger'

jobs:
Tests:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
requirements-level: [min, pypi]

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Generate dependencies
run: |
python -m pip install --upgrade pip setuptools py wheel requirements-builder
requirements-builder -e all --level=${{ matrix.requirements-level }} setup.py > .${{ matrix.requirements-level }}-${{ matrix.python-version }}-requirements.txt
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('.${{ matrix.requirements-level }}-${{ matrix.python-version }}-requirements.txt') }}

- name: Install dependencies
run: |
pip install -r .${{matrix.requirements-level}}-${{ matrix.python-version }}-requirements.txt
pip install .[all]
pip freeze
- name: Run tests
run: |
./run-tests.sh
60 changes: 0 additions & 60 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -121,5 +121,5 @@ Before you submit a pull request, check that it meets these guidelines:
2. If the pull request adds functionality, the docs should be updated. Put
your new functionality into a function with a docstring.
3. The pull request should work for Python 2.7, 3.3, 3.4 and 3.5. Check
https://travis-ci.com/inveniosoftware/invenio-logging/pull_requests
https://github.com/inveniosoftware/invenio-logging/actions?query=event%3Apull_request
and make sure that the tests pass for all supported Python versions.
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
.. image:: https://img.shields.io/github/license/inveniosoftware/invenio-logging.svg
:target: https://github.com/inveniosoftware/invenio-logging/blob/master/LICENSE

.. image:: https://img.shields.io/travis/inveniosoftware/invenio-logging.svg
:target: https://travis-ci.org/inveniosoftware/invenio-logging
.. image:: https://github.com/inveniosoftware/invenio-logging/workflows/CI/badge.svg
:target: https://github.com/inveniosoftware/invenio-logging/actions

.. image:: https://img.shields.io/coveralls/inveniosoftware/invenio-logging.svg
:target: https://coveralls.io/r/inveniosoftware/invenio-logging
Expand Down
4 changes: 2 additions & 2 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
# under the terms of the MIT License; see LICENSE file for more details.

[pytest]
pep8ignore = docs/conf.py ALL
ddopts = --pep8 --doctest-glob="*.rst" --doctest-modules --cov=invenio_logging --cov-report=term-missing docs tests invenio_logging
addopts = --isort --pydocstyle --pycodestyle --doctest-glob="*.rst" --doctest-modules --cov=invenio_logging --cov-report=term-missing tests invenio_logging
filterwarnings = ignore::pytest.PytestDeprecationWarning
testpaths = tests invenio_logging
3 changes: 1 addition & 2 deletions run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
# under the terms of the MIT License; see LICENSE file for more details.

pydocstyle invenio_logging && \
isort invenio_logging tests --check-only --diff && \
check-manifest --ignore ".travis-*" && \
check-manifest --ignore "*-requirements.txt" && \
sphinx-build -qnNW docs docs/_build/html && \
python setup.py test
13 changes: 4 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,11 @@
history = open('CHANGES.rst').read()

tests_require = [
'check-manifest>=0.25',
'coverage>=4.0',
'flask-login>=0.3.2,<0.5.0',
'httpretty>=0.8.14',
'isort>=4.2.2',
'mock>=1.3.0',
'pydocstyle>=1.0.0',
'pytest-cov>=1.8.0',
'pytest-pep8>=1.0.6',
'pytest>=2.8.0',
'pytest-invenio>=1.4.0',
'iniconfig>=1.1.1',
]

extras_require = {
Expand All @@ -35,7 +30,7 @@
'tests': tests_require,
'sentry': [
'raven[flask]>=6',
'flask-celeryext>=0.2.2'],
'flask-celeryext>=0.3.4'],
'sentry-sdk':
['sentry-sdk[flask]>=0.10.2']
}
Expand All @@ -49,7 +44,7 @@
]

install_requires = [
'invenio-base>=1.2.2',
'invenio-base>=1.2.3',
]

packages = find_packages()
Expand Down
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def pywarnlogger():
yield logger
logger.handlers = []


@pytest.yield_fixture()
def sentry_emit():
"""Mock Sentry emit."""
Expand Down

0 comments on commit b5c7e28

Please sign in to comment.