Skip to content

Commit

Permalink
Adds GitHub actions.
Browse files Browse the repository at this point in the history
  • Loading branch information
Daverball committed May 4, 2021
1 parent 91d176e commit 5361ec3
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 5 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/python-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Upload Python Package

on:
release:
types: [created]

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- 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/*
25 changes: 25 additions & 0 deletions .github/workflows/python-tox.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Python tests

on:
- push
- pull_request

jobs:
build:
runs-on: ubuntu-latest
strategy:
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
pip install tox tox-gh-actions
- name: Test with tox
run: tox -- --codecov-token=${{ secrets.CODECOV_TOKEN }}
2 changes: 1 addition & 1 deletion src/pytest_codecov/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
slug = '/'.join(_parts[-2:])


except ImportError:
except Exception:
# For now we just ignore every error, so we don't have to
# double wrap the try block with GitPython specific exceptions
pass
16 changes: 12 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
[tox]
envlist = py36,py37,py38,flake8,report
envlist = py36,py37,py38,py39,flake8,report

[tool:pytest]
testpaths = tests

[gh-actions]
python =
3.6: py36
3.7: py37
3.8: py38,flake8
3.9: py39

[testenv]
setenv =
py{36,37,38}: COVERAGE_FILE = .coverage.{envname}
commands = pytest --cov --cov-report= {posargs:-vv}
py{36,37,38,39}: COVERAGE_FILE = .coverage.{envname}
commands = pytest --cov --cov-report= --codecov {posargs:-vv}
deps =
pytest
coverage
pytest-cov
pytest-codecov
.
GitPython

[testenv:flake8]
skip_install = true
Expand Down

0 comments on commit 5361ec3

Please sign in to comment.