Skip to content

Commit

Permalink
replace Travis testing with GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
jbloom committed Jul 19, 2023
1 parent fe19847 commit 9aa5522
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 36 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Run tests

on:
push:
branches:
- main
- test-gh-actions
pul_request:
branches:
- main

jobs:
test:
name: Run tests
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: checkout
uses: actions/checkout@v3

- name: install python
uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: install package and dependencies
run: pip install -e . && pip install -r test_requirements

- name: lint code with ruff
run: ruff check .

- name: check code format with black
run: black --check .

- name: test code with `pytest`
run: pytest
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*.out
_*

!.github
!.gitignore
!.travis.yml
!.nojekyll
Expand Down
21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.

1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ The format is based on `Keep a Changelog <https://keepachangelog.com>`_.
6.3
---
- Ensure ``PolyclonalCollection.sites`` attribute is always defined.
- Move testing from Travis to GitHub actions.

6.2
---
Expand Down
17 changes: 4 additions & 13 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Formatting
++++++++++
The code is formatted using `Black <https://black.readthedocs.io/en/stable/index.html>`_, which you can install using `pip install "black[jupyter]"`.
You may also wish to install a Black extension in your editor to, for example, auto-format upon save.
In any case, please run Black using `black .` before submitting your PR, because the Travis tests will not pass unless the files have been formatted.
In any case, please run Black using `black .` before submitting your PR, because the tests will not pass unless the files have been formatted.
Note that this will change files/notebooks that you may be actively editing.

Versions and CHANGELOG
Expand Down Expand Up @@ -89,17 +89,9 @@ Then run the tests with pytest_ by running::

If you need to change the pytest_ configuration, edit the `pytest.ini <pytest.ini>`_ file.

Automated testing on Travis
+++++++++++++++++++++++++++
The aforementioned ruff_ and pytest_ tests will be run automatically by the Travis_ continuous integration system as specified in the `.travis.yml <.travis.yml>`_ file.
Note that running the Travis_ tests requires you to register the project with Travis_.

If the tests are passing, you will see this on the Travis_ badge on GitHub repo main page.

Slack notifications of test results
+++++++++++++++++++++++++++++++++++++
You can configure Travis_ to provide automatic Slack notifications of the test results.
To do that, follow the `instructions here <https://docs.travis-ci.com/user/notifications/#configuring-slack-notifications>`_.
Automated testing via GitHub Actions
++++++++++++++++++++++++++++++++++++
The aforementioned ruff_ and pytest_ tests will be run automatically by the continuous integration system as specified in the GitHub Actions file [.github/workflows/test.yaml](.github/workflows/test.yaml).


Building documentation
Expand All @@ -124,7 +116,6 @@ Note that this requires you to have registered the package on PyPI_ if this is t

.. _pytest: https://docs.pytest.org
.. _ruff: https://github.com/charliermarsh/ruff
.. _Travis: https://docs.travis-ci.com
.. _PyPI: https://pypi.org/
.. _pip: https://pip.pypa.io
.. _sphinx: https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html
Expand Down
10 changes: 8 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,14 @@ polyclonal
.. image:: https://img.shields.io/pypi/v/polyclonal.svg
:target: https://pypi.python.org/pypi/polyclonal

.. image:: https://app.travis-ci.com/jbloomlab/polyclonal.svg
:target: https://app.travis-ci.com/github/jbloomlab/polyclonal
.. image:: https://github.com/jbloomlab/polyclonal/actions/workflows/test.yaml/badge.svg
:target: https://github.com/jbloomlab/polyclonal/actions/workflows/test.yaml

.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black

.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json
:target: https://github.com/astral-sh/ruff

Model mutational escape from polyclonal antibodies using deep mutational scanning data.

Expand Down

0 comments on commit 9aa5522

Please sign in to comment.