Skip to content

Commit

Permalink
Migrate from Travis to GitHub Actions
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Finucane <stephen@that.guru>
  • Loading branch information
stephenfin committed Sep 4, 2023
1 parent 9985d6e commit 31d2857
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 37 deletions.
88 changes: 88 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
---
name: CI
on:
- push
- pull_request
jobs:
lint:
name: Run linters
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install dependencies
run: python -m pip install tox
- name: Run tox
run: tox -e style
test:
name: Run unit tests
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.8", "3.9", "3.10", "3.11"]
steps:
- name: Checkout source code
uses: actions/checkout@v3
# We need history to build the package
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: python -m pip install tox
- name: Run unit tests (via tox)
# Run tox using the version of Python in `PATH`
run: tox -e py
docs:
name: Build docs
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v3
# We need history for release notes
with:
fetch-depth: 0
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install dependencies
run: python -m pip install tox
- name: Build docs (via tox)
run: tox -e docs
- name: Archive build results
uses: actions/upload-artifact@v3
with:
name: html-docs-build
path: docs/_build/html
retention-days: 7
release:
name: Upload release artifacts
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'push'
steps:
- name: Checkout source code
uses: actions/checkout@v3
# We need history to build the package
with:
fetch-depth: 0
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install dependencies
run: python -m pip install build
- name: Build a binary wheel and a source tarball
run: python -m build --sdist --wheel --outdir dist/ .
- name: Publish distribution to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}
30 changes: 0 additions & 30 deletions .travis.yml

This file was deleted.

5 changes: 3 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
sphinxcontrib-apidoc
====================

.. image:: https://travis-ci.org/sphinx-contrib/apidoc.svg?branch=master
:target: https://travis-ci.org/sphinx-contrib/apidoc
.. image:: https://github.com/sphinx-contrib/apidoc/actions/workflows/ci.yaml/badge.svg
:target: https://github.com/sphinx-contrib/apidoc/actions/workflows/ci.yaml
:alt: Build Status

A Sphinx extension for running `sphinx-apidoc`_ on each build.

Expand Down
5 changes: 0 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,3 @@ commands =
yapf -rd sphinxcontrib tests
flake8 sphinxcontrib tests setup.py
doc8 -q README.rst

[travis]
python =
2.7: py27, style
3.6: py36, mypy

0 comments on commit 31d2857

Please sign in to comment.