Skip to content

Commit

Permalink
feat: set up github actions
Browse files Browse the repository at this point in the history
Signed-off-by: Luka Peschke <[email protected]>
  • Loading branch information
lukapeschke committed Jan 25, 2022
1 parent 640dc53 commit 44c696a
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
on: [push, pull_request]

name: Continuous Integration

jobs:
tests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
python-version:
- '3.8'
- '3.9'
- '3.10'

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: |
pip install -U pip
pip install tox tox-gh-actions
- name: Run tox
run: tox
39 changes: 39 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
on:
push:
tags:
- "*"

name: Release

jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: 3.10

- name: Install dependencies
run: |
pip install -U pip
pip install poetry
- name: Build
run: poetry build

- name: Publish release
uses: ncipollo/release-action@v1
with:
artifacts: "dist/*.whl, dist/*.tar.gz"
token: ${{ secrets.GITHUB_TOKEN }}

- name: Publish package to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
Empty file added tests/__init__.py
Empty file.
8 changes: 8 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,16 @@ isolated_build = true
envlist = py38,py39,py310,pylint,mypy

[testenv]
deps =
pytest
commands = pytest -vv --doctest-modules tests/ chainiter/

[gh-actions]
python =
3.8: py38,mypy,pylint
3.9: py39,mypy,pylint
3.10: py310,mypy,pylint

[testenv:pylint]
deps =
pylint
Expand Down

0 comments on commit 44c696a

Please sign in to comment.