diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 00000000..4fa7eb31 --- /dev/null +++ b/.github/workflows/test.yaml @@ -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 diff --git a/.gitignore b/.gitignore index 53395321..f2e85c97 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ *.out _* +!.github !.gitignore !.travis.yml !.nojekyll diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 00079754..00000000 --- a/.travis.yml +++ /dev/null @@ -1,21 +0,0 @@ -dist: xenial - -language: python - -python: - - "3.9" - -cache: pip - -install: - - pip install -r test_requirements.txt - - pip install -e . - -script: - - ruff check . - - black --check . - - pytest - -branches: - only: - - main diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 34b40047..98a7e611 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -9,6 +9,7 @@ The format is based on `Keep a Changelog `_. 6.3 --- - Ensure ``PolyclonalCollection.sites`` attribute is always defined. +- Move testing from Travis to GitHub actions. 6.2 --- diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 55cb7562..cff5103f 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -40,7 +40,7 @@ Formatting ++++++++++ The code is formatted using `Black `_, 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 @@ -89,17 +89,9 @@ Then run the tests with pytest_ by running:: If you need to change the pytest_ configuration, edit the `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 `_. +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 @@ -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 diff --git a/README.rst b/README.rst index e323be7f..c242bb20 100644 --- a/README.rst +++ b/README.rst @@ -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.