Skip to content

Commit

Permalink
Replace Travis by Github Actions (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
J535D165 committed Feb 24, 2020
1 parent 3082e99 commit d1011dc
Show file tree
Hide file tree
Showing 14 changed files with 175 additions and 310 deletions.
1 change: 0 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,4 @@ omit =
tests/*
docs/*
recordlinkage/_version.py
recordlinkage/compat/six.py
recordlinkage/types.py
42 changes: 42 additions & 0 deletions .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: tests

on: [push, pull_request]

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.6, 3.7, 3.8]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Package recordlinkage
run: |
pip install --upgrade pip
pip install wheel
python setup.py bdist_wheel sdist
- name: Install recordlinkage
run: |
pip install networkx>=2
pip install ./dist/recordlinkage-*.whl
- name: Lint with flake8
run: |
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pip install pytest
# remove recordlinkage to prevent relative imports (use installed package)
# this is like wrapping stuff in a src folder
rm -r recordlinkage/
pytest
63 changes: 63 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: deploy-and-release

on:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Get the version (git tag)
id: get_version
run: |
echo ${GITHUB_REF/refs\/tags\/v/}
echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel
- name: Build
run: |
python setup.py sdist bdist_wheel
- name: Create Release
id: create_release
uses: actions/create-release@v1.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Upload Release Asset (Wheel)
id: upload-release-asset-whl
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/recordlinkage-${{ steps.get_version.outputs.VERSION }}-py3-none-any.whl
asset_name: recordlinkage-${{ steps.get_version.outputs.VERSION }}-py3-none-any.whl
asset_content_type: application/x-wheel+zip
- name: Upload Release Asset (Sdist)
id: upload-release-asset-sdist
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/recordlinkage-${{ steps.get_version.outputs.VERSION }}.tar.gz
asset_name: recordlinkage-${{ steps.get_version.outputs.VERSION }}.tar.gz
asset_content_type: application/zip
- name: Publish package
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_password }}
19 changes: 19 additions & 0 deletions .github/workflows/render-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: build-docs
on: [push, pull_request]

jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.8'
- name: Install recordlinkage
run: |
pip install .[all]
- uses: ammaraskar/sphinx-action@master
with:
docs-folder: "docs/"
repo-token: "${{ secrets.GITHUB_TOKEN }}"
36 changes: 0 additions & 36 deletions .travis.yml

This file was deleted.

8 changes: 4 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Python Record Linkage Toolkit
=============================

|pypi| |travis| |codecov| |docs| |zenodo|
|pypi| |actions| |codecov| |docs| |zenodo|

.. |travis| image:: https://travis-ci.org/J535D165/recordlinkage.svg?branch=master
:target: https://travis-ci.org/J535D165/recordlinkage
:alt: TravisCI Status
.. |actions| image:: https://github.com/J535D165/recordlinkage/workflows/tests/badge.svg?branch=master
:target: https://github.com/J535D165/recordlinkage/actions
:alt: Github Actions CI Status

.. |pypi| image:: https://badge.fury.io/py/recordlinkage.svg
:target: https://pypi.python.org/pypi/recordlinkage/
Expand Down
137 changes: 0 additions & 137 deletions asv.conf.json

This file was deleted.

45 changes: 0 additions & 45 deletions deploy.sh

This file was deleted.

Loading

0 comments on commit d1011dc

Please sign in to comment.