Skip to content

Commit

Permalink
Test and release with GitHub actions
Browse files Browse the repository at this point in the history
  • Loading branch information
kalekundert committed Jun 10, 2020
1 parent fe5c93c commit 9abf3ac
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 27 deletions.
25 changes: 0 additions & 25 deletions .github/workflows/python.yml

This file was deleted.

65 changes: 65 additions & 0 deletions .github/workflows/test_and_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Test and release

on: [push]

jobs:

test-python:
name: Test Python
runs-on: ubuntu-latest

strategy:
matrix:
python-version: [3.6, 3.7, 3.8]

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install test dependencies
run: |
python -m pip install --upgrade pip
pip install '.[tests]'
- name: Run test suite
run: |
pytest
test-r:
name: Test R
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: rlib/actions/setup-r@v1
- name: Install test dependencies
shell: Rscript {0}
run: |
install.packages(c("remotes", "rcmdcheck"))
remotes::install_deps(dependencies = TRUE)
- name: Run test suite
shell: Rscript {0}
run: rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "error")

release:
name: Release to PyPI
runs-on: ubuntu-latest
needs:
- test-python
- test-r

steps:
- uses: actions/checkout@v2
with:
# Make sure the whole repository history is present, so that
# python-semantic-release can decide if a new release is needed.
fetch-depth: 0

- uses: relekang/python-semantic-release@v7
with:
github_token: ${{ sectrets.GITHUB_TOKEN }}
pypi_token: ${{ secrets.PYPI_TOKEN }}




4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ __ https://wellmap.readthedocs.io/en/latest/file_format.html
.. image:: https://img.shields.io/pypi/pyversions/wellmap.svg
:target: https://pypi.python.org/pypi/wellmap

.. image:: https://img.shields.io/travis/kalekundert/wellmap.svg
:target: https://travis-ci.org/kalekundert/wellmap
.. image:: https://img.shields.io/github/workflow/status/kalekundert/wellmap/Test and Release/master
:target: https://github.com/kalekundert/wellmap/actions

.. image:: https://readthedocs.org/projects/wellmap/badge/?version=latest
:target: http://wellmap.readthedocs.io/en/latest/
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,6 @@ wellmap = "wellmap.plot:main"
'Bug Tracker' = 'https://github.com/kalekundert/wellmap/issues'
'Continuous Integration' = 'https://travis-ci.org/kalekundert/wellmap'
'Test Coverage' = 'https://coveralls.io/github/kalekundert/wellmap'

[tool.semantic-release]
version_variable = wellmap/__init__.py:__version__

0 comments on commit 9abf3ac

Please sign in to comment.