Skip to content
This repository was archived by the owner on Oct 24, 2025. It is now read-only.

Commit d7bad20

Browse files
committed
Migrating from Travis to GitHub workflows.
1 parent 600df51 commit d7bad20

4 files changed

Lines changed: 94 additions & 26 deletions

File tree

.github/workflows/Workflow.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: Test, Collect Coverage and Release if tagged
2+
3+
on: [push]
4+
5+
jobs:
6+
test:
7+
name: Test and collect coverage data
8+
runs-on: ubuntu-latest
9+
strategy:
10+
fail-fast: false
11+
max-parallel: 3
12+
matrix:
13+
python-version: [ 3.6, 3.7, 3.8 ]
14+
15+
env:
16+
PYTHON: ${{ matrix.python-version }}
17+
steps:
18+
- uses: actions/checkout@v2
19+
20+
- name: Setup Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v2
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install -r tests/requirements.txt
29+
30+
- name: Run unit tests
31+
run: |
32+
python -m unittest tests.unit.TerminalUI
33+
34+
- name: Collect coverage
35+
run: |
36+
coverage run --append -m unittest tests.unit.TerminalUI
37+
38+
- name: Report coverage
39+
run: |
40+
coverage report
41+
coverage xml
42+
43+
- name: Publish coverage at CodeCov
44+
uses: codecov/codecov-action@v1
45+
with:
46+
file: ./coverage.xml
47+
flags: unittests
48+
env_vars: PYTHON
49+
50+
- name: Publish coverage at Codacy
51+
uses: codacy/codacy-coverage-reporter-action@master
52+
with:
53+
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
54+
coverage-reports: ./coverage.xml
55+
56+
release:
57+
name: Build packages and publish to PyPI if tagged
58+
needs: [ test ]
59+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
60+
runs-on: ubuntu-latest
61+
env:
62+
PYTHON: "3.8"
63+
steps:
64+
- uses: actions/checkout@v2
65+
66+
- name: Setup Python ${{ env.PYTHON }}
67+
uses: actions/setup-python@v2
68+
with:
69+
python-version: ${{ env.PYTHON }}
70+
71+
- name: Install dependencies for packaging and release
72+
run: |
73+
python -m pip install --upgrade pip
74+
pip install wheel twine
75+
76+
- name: Build Python package (source distribution)
77+
run: |
78+
python setup.py sdist
79+
80+
- name: Build Python package (binary distribution - wheel)
81+
run: |
82+
python setup.py bdist_wheel
83+
84+
- name: Release Python package to PyPI
85+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
86+
env:
87+
TWINE_USERNAME: __token__
88+
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
89+
run: |
90+
twine upload dist/*

.idea/pyTerminalUI.iml

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.travis.yml

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

doc/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
'issue': ('https://github.com/Paebbels/pyTerminalUI/issues/%s', 'issue #'),
117117
'pull': ('https://github.com/Paebbels/pyTerminalUI/pull/%s', 'pull request #'),
118118
'src': ('https://github.com/Paebbels/pyTerminalUI/blob/master/pyTerminalUI/%s?ts=2', None),
119-
# 'test': ('https://github.com/Paebbels/pyCallBy/blob/master/test/%s?ts=2', None)
119+
# 'tests': ('https://github.com/Paebbels/pyCallBy/blob/master/test/%s?ts=2', None)
120120
}
121121

122122

0 commit comments

Comments
 (0)