-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
521 additions
and
328 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
|
||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
tests: | ||
name: pytest on ${{ matrix.python-version }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10"] | ||
|
||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
- name: Setup Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Upgrade pip | ||
run: | | ||
python -m pip install --upgrade pip | ||
- name: Install requirements (Python 3) | ||
if: matrix.python-version != '2.7' | ||
run: | | ||
pip install -r requirements/ci.txt | ||
- name: Install requirements (Python 2) | ||
if: matrix.python-version == '2.7' | ||
run: | | ||
pip install pillow pytest coverage | ||
- name: Install PyPDF2 | ||
run: | | ||
pip install . | ||
- name: Test with flake8 | ||
run: | | ||
flake8 . --ignore=E203,W503,W504,E,F403,F405 | ||
if: matrix.python-version != '2.7' | ||
- name: Test with pytest | ||
run: | | ||
python -m coverage run --parallel-mode -m pytest Tests -vv | ||
- name: Upload coverage data | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: coverage-data | ||
path: .coverage.* | ||
if-no-files-found: ignore | ||
|
||
package: | ||
name: Build & verify package | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{env.PYTHON_LATEST}} | ||
|
||
- run: python -m pip install build twine check-wheel-contents | ||
- run: python -m build --sdist --wheel . | ||
- run: ls -l dist | ||
- run: check-wheel-contents dist/*.whl | ||
- name: Check long_description | ||
run: python -m twine check dist/* | ||
|
||
coverage: | ||
name: Combine & check coverage. | ||
runs-on: ubuntu-latest | ||
needs: tests | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v3 | ||
with: | ||
# Use latest Python, so it understands all syntax. | ||
python-version: ${{env.PYTHON_LATEST}} | ||
|
||
- run: python -m pip install --upgrade coverage[toml] | ||
|
||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: coverage-data | ||
|
||
- name: Combine coverage & create xml report | ||
run: | | ||
python -m coverage combine | ||
python -m coverage xml | ||
- name: Upload Coverage to Codecov | ||
uses: codecov/codecov-action@v2 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
files: ./coverage.xml |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.