-
-
Notifications
You must be signed in to change notification settings - Fork 453
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
1 changed file
with
64 additions
and
0 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,64 @@ | ||
name: Python package | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
lint: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
max-parallel: 3 # We need this limit or else the tests fail | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macOS-latest] | ||
python-version: [3.6, 3.7, 3.8] | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Upgrade all installed pip packages (setuptools, pip, etc.) | ||
run: pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U | ||
- name: Install project dependencies | ||
run: python setup.py install | ||
- name: Install test dependencies | ||
run: pip install black flake8 pydocstyle sphinx sphinx_rtd_theme | ||
- name: Check code formatting with black | ||
run: black --check --verbose . | ||
- name: Lint with flake8 | ||
run: flake8 --exclude=.eggs,build,docs | ||
- name: Check docstyle with pydocstyle | ||
run: pydocstyle praw | ||
- name: Build Sphinx files | ||
run: sphinx-build -W docs/ /tmp/foo | ||
test: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
max-parallel: 4 # We need this limit or else the tests fail | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macOS-latest] | ||
python-version: [3.5, 3.6, 3.7, 3.8] | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Upgrade all installed pip packages (setuptools, pip, etc.) | ||
run: pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U | ||
- name: Get wheel | ||
run: pip install wheel | ||
- name: Install project dependencies | ||
run: python setup.py install | ||
- name: Install test dependencies | ||
run: pip install pytest coverage | ||
- name: Install betamax and plugins | ||
# Windows + Python 3.8 bypass attempts | ||
run: | | ||
pip install "betamax >=0.8, <0.9" | ||
pip install "betamax-matchers >=0.3.0, <0.5" | ||
pip install "betamax-serializers >=0.2, <0.3" | ||
- name: Run tests | ||
run: python -m coverage run ./setup.py test | ||
- name: Print coverage | ||
run: coverage report --include "praw/*" --fail-under=100 |