Skip to content

Commit 2d058c6

Browse files
committed
Switched from Travis to Github Actions
1 parent 4d16324 commit 2d058c6

File tree

3 files changed

+93
-69
lines changed

3 files changed

+93
-69
lines changed

.github/workflows/codeqa-test.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Python codeqa/test
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
8+
jobs:
9+
lint:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Set up Python
14+
uses: actions/setup-python@v2
15+
with:
16+
python-version: 3.x
17+
- uses: actions/cache@v2
18+
with:
19+
path: ~/.cache/pip
20+
key: pip-lint
21+
- name: Install dependencies
22+
run: pip install flake8
23+
- name: Run flake8
24+
run: flake8 sphinx_autodoc_typehints.py tests
25+
26+
test:
27+
needs: [lint]
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
os: [ubuntu-latest]
32+
python-version: [3.5, 3.6, 3.7, 3.8, 3.9]
33+
runs-on: ${{ matrix.os }}
34+
steps:
35+
- uses: actions/checkout@v2
36+
- name: Set up Python ${{ matrix.python-version }}
37+
uses: actions/setup-python@v2
38+
with:
39+
python-version: ${{ matrix.python-version }}
40+
- uses: actions/cache@v2
41+
with:
42+
path: ~/.cache/pip
43+
key: pip-test-${{ matrix.python-version }}-${{ matrix.os }}
44+
- name: Install dependencies
45+
run: pip install .[test] coveralls
46+
- name: Test with pytest
47+
run: coverage run -m pytest
48+
- name: Upload Coverage
49+
run: coveralls --service=github
50+
env:
51+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52+
COVERALLS_FLAG_NAME: ${{ matrix.test-name }}
53+
COVERALLS_PARALLEL: true
54+
55+
coveralls:
56+
name: Finish Coveralls
57+
needs: test
58+
runs-on: ubuntu-latest
59+
container: python:3-slim
60+
steps:
61+
- name: Finished
62+
run: |
63+
pip install coveralls
64+
coveralls --service=github --finish
65+
env:
66+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/publish.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Publish packages to PyPI
2+
3+
on:
4+
push:
5+
tags:
6+
- "[0-9]+.[0-9]+.[0-9]+"
7+
- "[0-9]+.[0-9]+.[0-9]+[a-b][0-9]+"
8+
- "[0-9]+.[0-9]+.[0-9]+rc[0-9]+"
9+
10+
jobs:
11+
publish:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Set up Python
16+
uses: actions/setup-python@v2
17+
with:
18+
python-version: 3.x
19+
- name: Install dependencies
20+
run: pip install build
21+
- name: Create packages
22+
run: python -m build -s -w .
23+
- name: Upload packages
24+
uses: pypa/gh-action-pypi-publish@master
25+
with:
26+
user: __token__
27+
password: ${{ secrets.pypi_password }}

.travis.yml

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

0 commit comments

Comments
 (0)