summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Finucane <stephen@that.guru>2022-06-16 16:57:16 +0100
committerStephen Finucane <stephenfinucane@hotmail.com>2022-06-16 19:32:21 +0200
commitc21fe7a188274e9b10fa32b0f32d156f4a4460ef (patch)
treec968099fb1a9f7c50d31a2abf280ab76221fb67d
parent42d863fc76b481a8b2f7b1890f7d976bef91cce3 (diff)
downloadwarlock-c21fe7a188274e9b10fa32b0f32d156f4a4460ef.tar.gz
Switch from Travis to GitHub Actions
You need to file paperwork to use Travis with open source projects. Just use GitHub Actions. Signed-off-by: Stephen Finucane <stephen@that.guru>
-rw-r--r--.github/workflows/ci.yaml47
-rw-r--r--.travis.yml42
-rw-r--r--CONTRIBUTING.md2
-rw-r--r--README.md4
4 files changed, 50 insertions, 45 deletions
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
new file mode 100644
index 0000000..8f3a811
--- /dev/null
+++ b/.github/workflows/ci.yaml
@@ -0,0 +1,47 @@
+---
+name: CI
+on:
+ - push
+ - pull_request
+jobs:
+ test:
+ name: Run unit tests
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ python: ['3.7', '3.8', '3.9', '3.10']
+ steps:
+ - name: Checkout source code
+ uses: actions/checkout@v2
+ - name: Set up Python ${{ matrix.python }}
+ uses: actions/setup-python@v2
+ 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
+ release:
+ name: Upload release artifacts
+ runs-on: ubuntu-latest
+ needs: test
+ if: github.event_name == 'push'
+ steps:
+ - name: Checkout source code
+ uses: actions/checkout@v2
+ with:
+ fetch-depth: 0
+ - name: Set up Python
+ uses: actions/setup-python@v2
+ with:
+ python-version: '3.10'
+ - 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 }}
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 36e6c62..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,42 +0,0 @@
-language: python
-python: 3.6
-cache:
- pip: true
- directories:
- - "$TRAVIS_BUILD_DIR/.tox"
-
-stages:
- - linting
- - test
-
-install:
- - pip install tox-travis poetry==1.0.0
-
-script:
- - tox
-
-jobs:
- include:
- - python: 3.5
- - python: 3.6
- - python: 3.7
- - python: 3.8
- dist: xenial
- before_script:
- - pip install coveralls
- after_success:
- - coveralls
-
- - stage: linting
- python: 3.7
- dist: xenial
- install:
- - pip install -U pre-commit
- script:
- - pre-commit run --all-files --verbose
- env:
- - PRE_COMMIT_HOME="$TRAVIS_HOME/.cache/pre-commit"
- cache:
- pip: true
- directories:
- - "$PRE_COMMIT_HOME"
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index a79e927..790c6be 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -3,5 +3,5 @@
Pull Requests are greatly welcome from everyone! Please make sure to fulfill the following criteria when proposing changes to Warlock:
- Write unit tests, and run them through pytest; test coverage must not decrease
-- Make sure to support Python 2.7 -- 3.7; Travis CI will check all non-EOL version of Python
+- Make sure to test against different Python versions; CI will check all non-EOL version of Python
- Run flake8 without warnings; including flake8-bugbear plugin
diff --git a/README.md b/README.md
index dd57b2b..8efc66a 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,7 @@
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/warlock.svg)][warlock]
[![PyPI - Downloads](https://img.shields.io/pypi/dw/warlock.svg)][pypistats]
-[![Build Status](https://travis-ci.org/bcwaldon/warlock.svg?branch=master)][ci-builds]
+[![Build Status](https://github.com/bcwaldon/warlock/actions/workflows/ci.yaml/badge.svg)][ci-builds]
[![Coverage Status](https://coveralls.io/repos/github/bcwaldon/warlock/badge.svg?branch=master)][coveralls]
![GitHub commits since latest release (branch)](https://img.shields.io/github/commits-since/bcwaldon/warlock/latest/master.svg)
@@ -78,7 +78,7 @@ pip install warlock
[warlock]: https://pypi.org/project/warlock/
[pip]: https://pip.pypa.io/en/stable/
-[ci-builds]: https://travis-ci.org/bcwaldon/warlock
+[ci-builds]: https://github.com/bcwaldon/warlock/actions/workflows/ci.yaml
[coveralls]: https://coveralls.io/github/bcwaldon/warlock?branch=master
[poetry]: https://poetry.eustace.io/docs/
[pypistats]: https://pypistats.org/packages/warlock