Skip to content

Commit 0a7370e

Browse files
authored
Use github actions (#13)
1 parent 2043607 commit 0a7370e

File tree

3 files changed

+47
-25
lines changed

3 files changed

+47
-25
lines changed

.github/workflows/build.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Build and Deploy
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
python-version: [3.6, 3.7, 3.8]
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Setup Python # Set Python version
16+
uses: actions/setup-python@v2
17+
with:
18+
python-version: ${{ matrix.python-version }}
19+
- name: Install dependencies
20+
run: |
21+
python -m pip install --upgrade pip
22+
pip install poetry
23+
pip install pylint
24+
poetry install -v
25+
- name: Run pylint
26+
run: pylint varname.py
27+
- name: Test with pytest
28+
run: poetry run pytest tests/ --junitxml=junit/test-results-${{ matrix.python-version }}.xml
29+
- name: Upload pytest test results
30+
uses: actions/upload-artifact@v2
31+
with:
32+
name: pytest-results-${{ matrix.python-version }}
33+
path: junit/test-results-${{ matrix.python-version }}.xml
34+
# Use always() to always run this step to publish test results when there are test failures
35+
if: ${{ always() }}
36+
- name: Run codacy-coverage-reporter
37+
uses: codacy/codacy-coverage-reporter-action@master
38+
if: matrix.python-version == 3.8
39+
with:
40+
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
41+
coverage-reports: .coverage.xml
42+
- name: Publish to PyPI
43+
if: success() && matrix.python-version == 3.8 && github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
44+
run: poetry publish --build -u ${{ secrets.pypi_user }} -p ${{ secrets.pypi_password }}
45+

.travis.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

varname.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ class VarnameRetrievingError(Exception):
2626
def _get_frame(caller):
2727
try:
2828
return sys._getframe(caller + 1)
29-
except Exception as e:
30-
raise VarnameRetrievingError from e
29+
except Exception as exc:
30+
raise VarnameRetrievingError from exc
3131

3232

3333
def _get_node(caller):

0 commit comments

Comments
 (0)