Skip to content

Commit

Permalink
Merge pull request #26 from melexis/move-to-gh-actions
Browse files Browse the repository at this point in the history
Move from Travis CI to GitHub Actions
  • Loading branch information
Letme authored Mar 2, 2022
2 parents ceec6ba + 660ec9c commit f5d8c39
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 71 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Test and deploy on tag

on: push

jobs:
test:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox tox-gh-actions
- name: Build documentation with Sphinx 2.1
run: tox -e sphinx-latest
- name: Build documentation with latest Sphinx versions
run: tox -e sphinx-latest
- name: Static checks
if: matrix.python-version == 3.9
run: tox -e check
- name: Upload HTML documentation
if: matrix.python-version == 3.9
uses: actions/upload-artifact@v2
with:
name: html-doc
path: doc/_build/html

deploy:

if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Download HTML documentation from job 'test'
uses: actions/download-artifact@v2
with:
name: html-doc
path: doc/_build/html
- name: Disable jekyll
run: touch doc/_build/html/.nojekyll
- name: Deploy documentation
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: doc/_build/html
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.7'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
63 changes: 0 additions & 63 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[metadata]
description-file = README.rst
description_file = README.rst

[bdist_wheel]
universal=1
Expand Down
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Topic :: Documentation',
'Topic :: Documentation :: Sphinx',
'Topic :: Utilities',
Expand Down
26 changes: 19 additions & 7 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
[tox]
envlist =
check,
{py37},
py36, py37, py38, py39,
sphinx2.1,
sphinx-latest,

[gh-actions]
python =
3.6: py36
3.7: py37
3.8: py38
3.9: py39
{sphinx2.1,sphinx-latest},

[testenv]
basepython =
py: python3
py36: {env:TOXPYTHON:python3.6}
py37: {env:TOXPYTHON:python3.7}
check: python3
{sphinx2.1,sphinx-latest}: python3
py38: {env:TOXPYTHON:python3.8}
py39: {env:TOXPYTHON:python3.9}
{check,sphinx2.1,sphinx-latest}: python3
passenv =
*
usedevelop = true
Expand All @@ -21,15 +33,15 @@ deps=

[testenv:check]
deps =
docutils
twine
check-manifest
flake8
readme-renderer
skip_install = true
commands =
python setup.py check --strict --metadata --restructuredtext
python3 -m build
twine check --strict dist/*
check-manifest {toxinidir} -u
flake8 mlx tests setup.py
flake8 mlx setup.py

[testenv:sphinx2.1]
deps=
Expand Down

0 comments on commit f5d8c39

Please sign in to comment.