Add GitHub Actions integration

This commit is contained in:
Nikolaus Waxweiler 2020-11-20 10:06:27 +00:00
parent c7819e6bc3
commit 018a798fdd
3 changed files with 118 additions and 1 deletions

31
.github/workflows/publish.yml vendored Normal file
View File

@ -0,0 +1,31 @@
# This workflows will upload a Python Package using Twine when a tag is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
name: Upload Python Package
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
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: |
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/*

86
.github/workflows/test.yml vendored Normal file
View File

@ -0,0 +1,86 @@
name: Test
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.x
uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Install packages
run: pip install tox
- name: Run Tox
run: tox -e mypy,package_readme
test:
runs-on: ${{ matrix.platform }}
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
platform: [ubuntu-latest, macos-latest, windows-latest]
exclude: # Only test on the oldest and latest supported stable Python on macOS and Windows.
- platform: macos-latest
python-version: 3.7
- platform: macos-latest
python-version: 3.8
- platform: windows-latest
python-version: 3.7
- platform: windows-latest
python-version: 3.8
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 packages
run: pip install tox coverage
- name: Run Tox
run: tox -e py-cov
- name: Run Tox without lxml
run: tox -e py-cov-nolxml
- name: Produce coverage files
run: |
coverage combine
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
file: coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: true
test-cython:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.x
uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Install packages
run: pip install tox
- name: Run Tox
run: tox -e py-cy-nolxml
test-pypy3:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python pypy3
uses: actions/setup-python@v2
with:
python-version: "pypy3"
- name: Install packages
run: pip install tox
- name: Run Tox
run: tox -e pypy3-nolxml

View File

@ -16,7 +16,7 @@ deps =
pytest pytest
pytest-randomly pytest-randomly
-rrequirements.txt -rrequirements.txt
!nolxml: lxml==4.5.0 !nolxml: lxml==4.6.1
extras = extras =
ufo ufo
woff woff