Skip to content

Commit

Permalink
Merge pull request #40 from mirumee/update-ci
Browse files Browse the repository at this point in the history
Update CI pipeline to use Github Actions
  • Loading branch information
artursmet authored Oct 7, 2022
2 parents d4e860f + 9a45839 commit d1c4152
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Publish on PyPI

on:
release:
types:
- published
branches:
- master

jobs:
build-n-publish:
name: Build and publish to PyPI
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@master
- name: Set up Python 3.9
uses: actions/setup-python@v1
with:
python-version: 3.9
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- 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@v1.5.1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
37 changes: 37 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Tests

on:
push:
branches:
- master
pull_request:

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]

steps:
- uses: actions/checkout@v3
- 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 setup.py install
pip install mypy==v0.982 pytest pytest-cov pylint
- name: Pytest
run: |
pytest --cov=prices --cov=tests
- uses: codecov/codecov-action@v1
- name: Linters
run: |
pylint prices setup.py
mypy prices --ignore-missing-imports
continue-on-error: true
9 changes: 9 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[MASTER]
ignore=snapshots
load-plugins=pylint.extensions.bad_builtin, pylint.extensions.mccabe

[MESSAGES CONTROL]
disable=C0103, C0111, C0209, C0412, I0011, R0101, R0801, R0901, R0902, R0903, R0912, R0913, R0914, R0915, R1260, W0231, W0621, W0703

[SIMILARITIES]
ignore-imports=yes

0 comments on commit d1c4152

Please sign in to comment.