Skip to content

Commit

Permalink
global: migration to github-actions from travis
Browse files Browse the repository at this point in the history
closes #74
  • Loading branch information
Parth Shandilya committed Dec 3, 2020
1 parent 67a56f3 commit b59ea4a
Show file tree
Hide file tree
Showing 10 changed files with 126 additions and 80 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
43 changes: 43 additions & 0 deletions .github/workflows/pypi-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2020 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details

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
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 }}
62 changes: 62 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2020 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.

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 redis requirements-builder
requirements-builder -e all ${{ matrix.requirements-file }} --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 -e .[all]
pip freeze
- name: Run tests
run: |
./run-tests.sh
61 changes: 0 additions & 61 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,6 @@ Before you submit a pull request, check that it meets these guidelines:
1. The pull request should include tests and must not decrease test coverage.
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.org/inveniosoftware/invenio-app/pull_requests
3. The pull request should work for Python 3.6, 3.7 and 3.8. Check
https://github.com/inveniosoftware/invenio-app/actions?query=event%3Apull_request
and make sure that the tests pass for all supported Python versions.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ recursive-include docs *.txt
recursive-include docs Makefile
recursive-include tests *.py
recursive-include tests *.html
recursive-include .github/workflows *.yml
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-app.svg
:target: https://github.com/inveniosoftware/invenio-app/blob/master/LICENSE

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

.. image:: https://img.shields.io/coveralls/inveniosoftware/invenio-app.svg
:target: https://coveralls.io/r/inveniosoftware/invenio-app
Expand Down
5 changes: 3 additions & 2 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@

[pytest]
pep8ignore = docs/conf.py ALL
addopts = --pep8 --doctest-glob="*.rst" --doctest-modules --cov=invenio_app --cov-report=term-missing
filterwarnings = ignore::pytest.PytestDeprecationWarning
addopts = --isort --pydocstyle --pycodestyle --doctest-glob="*.rst" --doctest-modules --cov=invenio_app --cov-report=term-missing
testpaths = tests invenio_app
filterwarnings = ignore::pytest.PytestDeprecationWarning
14 changes: 10 additions & 4 deletions run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,16 @@
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.

# Quit on errors
set -o errexit

# Quit on unbound symbols
set -o nounset

export PYTEST_ADDOPTS='docs tests invenio_app'

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

tests_require = [
'check-manifest>=0.25',
'coverage>=4.5.3',
'isort>=4.3.21',
'pydocstyle>=3.0.0',
'pytest-cov>=2.7.1',
'pytest-pep8>=1.0.6',
'pytest>=4.6.4,<5.0.0',
'pytest-invenio>=1.4.0',
'redis>=2.10.5',
'mock>=2.0.0',
]
Expand Down

0 comments on commit b59ea4a

Please sign in to comment.