diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml new file mode 100644 index 0000000000..ea89980956 --- /dev/null +++ b/.github/workflows/pythonpackage.yml @@ -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