Skip to content

Commit

Permalink
global: migrate CI to gh-actions
Browse files Browse the repository at this point in the history
closes #10
  • Loading branch information
Parth Shandilya authored and Diego committed Dec 8, 2020
1 parent 484943f commit 5cd5e89
Show file tree
Hide file tree
Showing 10 changed files with 108 additions and 62 deletions.
4 changes: 2 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,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
42 changes: 42 additions & 0 deletions .github/workflows/pypi-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# -*- 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/gh-action-pypi-publish@v1.3.1
with:
user: __token__
# The token is provided by the inveniosoftware organization
password: ${{ secrets.pypi_token }}
46 changes: 46 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# -*- 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

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

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

- name: Install dependencies
run: |
pip install .[all]
pip freeze
- name: Run tests
run: |
./run-tests.sh
43 changes: 0 additions & 43 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 @@ -113,6 +113,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.5 and 3.6. Check
https://travis-ci.org/inveniosoftware/counter-robots/pull_requests
3. The pull request should work for 3.8. Check
https://github.com/inveniosoftware/counter-robots/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 @@ -14,6 +14,7 @@ include *.sh
include LICENSE
include pytest.ini
prune docs/_build
recursive-include .github/workflows *.yml
recursive-include counter_robots *.po *.pot *.mo
recursive-include counter_robots *.txt
recursive-include docs *.bat
Expand Down
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/counter-robots.svg
:target: https://github.com/inveniosoftware/counter-robots/blob/master/LICENSE

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

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

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

pydocstyle counter_robots tests docs && \
isort -rc -c -df && \
check-manifest --ignore ".travis-*" && \
sphinx-build -qnNW docs docs/_build/html && \
# Quit on errors
set -o errexit

# Quit on unbound symbols
set -o nounset

pydocstyle counter_robots tests docs
isort counter_robots 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.0',
'isort>=4.3.3',
'pydocstyle>=1.0.0',
'pytest-cov>=1.8.0',
'pytest-pep8>=1.0.6',
'pytest>=2.8.0',
'pytest-invenio>=1.4.0',
]

extras_require = {
Expand Down

0 comments on commit 5cd5e89

Please sign in to comment.